Example 28: Multi-series X/Y spline chart
Spline chart using 3
different colored series of X/Y data.
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:
Note: the code in the
Form1_Load event could be used in ASP.NET
applications as well.
Form Code
Imports
Super2d3dGraphLibrary
Public
Class
Form1
Private
Sub
Form1_Load(ByVal
sender
As
System.Object,
ByVal e
As
System.EventArgs)
Handles
MyBase.Load
' Prepare chart control
With
Super2d3dGraph1
.AutoRefresh =
False
.LicenseeIdentifier =
"STAND"
.Title =
"Multi-Series X/Y Spline Chart Sample"
.Style = STYLE2D3D.STYLE2D_XY_SPLINE
.ShowDataTable =
False
.ShowValues =
False
.ShowLegend =
False
' Y-Axis config
.YAxisScaleMaximum
= 45
.YAxisScaleMinimum
= 5
.YAxisScaleMode = SCALEMODE.SCALEMODE_FIXED
.YAxisNumericFormat =
"0"
' X-Axis config
.XAxisDividersCount
= 5
.XAxisScaleMinimum
= 0
.XAxisScaleMaximum
= 3000
.XAxisScaleMode =
SCALEMODE.SCALEMODE_FIXED
.ShowDividerX =
True
.ShowXAxis =
True
' Series special config
.PointSize = 1
.PointStyle =
STYLEPOINT.STYLEPOINT_CIRCLE
.SeriesLineStyle
=
New Pen()
{New
Pen(Color.Blue),
New
Pen(Color.Yellow),
New
Pen(Color.Green)}
End
With
' Add 3 series of random data
Dim
seriesFactory
As
New
SeriesFactory
Dim x
As
Single
For
serie
As
Integer
= 1
To
3
seriesFactory.NewSerie()
x = 0
For k
As
Integer
= 1
To
30
seriesFactory.AddPoint(x, Rnd() * 30 + 10)
x += 100
Next
Next
' Assign data and refresh chart
seriesFactory.ApplyTo(Super2d3dGraph1)
Super2d3dGraph1.RefreshChart()
End
Sub
End
Class
Result:

|