Super 2d/3d Graph Library

Enhance your .NET application adding nice charts within minutes! Save time and money!


Example 7: Date/time scale in the X-axis

 

Hello there!

In this example, I will show you how to use a datetime range for the X-axis. For simplicity, I will use a VB.NET windows application project.

 

Steps:

1. Create a new Windows application project (VB.NET)

2. Add Super 2d/3d Graph Library to the toolbox pallete and drag it to Form1

3. Copy and paste de following code:


Form Code

Imports Super2d3dGraphLibrary

Public Class Form1

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim v As New Super2d3dGraphLibrary.SeriesFactory
   
Dim x As Single

    ' Precalculate some random values
    For k As Integer = 0 To 8
       x = x + Int(Rnd() * 10) + 15
       v.AddValue(x)
    Next

    ' Populate the chart
    With Super2D3dGraph1
       .AutoRefresh = False
       .LicenseeIdentifier = "STAND" ' This is the demo license
       .Title = "Working with axis demo"
       .Style = STYLE2D3D.STYLE2D_BAR

       ' Don't show decimals on Y-Axis so I assign "0" (integer values)
      
.YAxisNumericFormat = "0"

       ' On X-axis I want a datetime scale
       .XAxisNumericFormat = "d" ' short date format (see VS help for
                                   DateTime string formats)

       ' Specify the range for the datetime scale
       .XAxisScaleMode = SCALEMODE.SCALEMODE_FIXED_DATETIME
       .XAxisScaleMinimumDateTime = #1/10/2007#
       .XAxisScaleMaximumDateTime = #4/20/2007#
      
.ShowXAxis = True

       ' Minor fancy adjustements
       .XAxisLabelsRotated = True
       .ShowLegend = False
       .ShowDataTable = False
       .ValuesLocationStyle =
                   STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE

   End With

   ' Assign the previous calculated values to the chart
   v.ApplyTo(Super2D3dGraph1)

   ' Show me the chart!
   Super2D3dGraph1.RefreshChart()

   End Sub

End Class


 

Result:


 

 

License & Purchase Info


Current version: 14

Super 2d/3d Graph Library is available as:
-Standard License (99€)
-Premium License (149€)
-Enterprise License (299€)

Click here for more details & purchase

Contact Info


Feel free to contact us
for questions related to any of our products or custom .Net development. We usually respond in the same labor day.

Software Siglo XXI

Main support service: support@softwaresigloxxi.com

Sales and other enquiries: contact@softwaresigloxxi.com