Create an spline area/line combo chart
This example is a little
more complicated because two charts are
involved and this time I'm customizing many
aspects of each chart. I demonstrate how to to
combine two instances of the chart library
and produce one fusioned chart (spline area
+ line types).
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
' Configure main chart (spline area chart)
Dim
arrBarChartValues(0)
As
ArrayList
arrBarChartValues(0) =
New
ArrayList
With
Super2D3dGraph1
.LicenseeIdentifier =
"PROF"
.AutoRefresh =
False
' Increase speed
.Style = STYLE2D3D.STYLE2D_SPLINE_AREA
.Title =
"Area/Line Combo Chart"
For k
As
Integer
= 0
To
15
arrBarChartValues(0).Add(Rnd() * 25000 + 25000)
Next
.Series = arrBarChartValues
' Assign values to area chart
.SeriesLegend =
New
String()
{"Income"}
.SeriesColor =
New
Color() {Color.LightYellow}
.YAxisScaleMode =
SCALEMODE.SCALEMODE_FIXED
.YAxisScaleMaximum
= 50000
.YAxisScaleMinimum = 0
.YAxisTitle =
"Y-Axis 1 Title"
.XAxisTitle =
"X-Axis Title"
.ShowValues =
False
' Hide values over chart
.ShowLegend =
True
.ShowPoints = False
.LegendAlignment =
STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_CENTER
.LegendText =
""
' Hide legend's title
.ShowDataTable =
False
End
With
' Now create the second chart (line chart)
Dim
oBarChart
As
New
Super2d3dGraphLibrary.Super2D3dGraph
Dim arrSeries(0)
As
ArrayList
arrSeries(0) =
New
ArrayList
Dim p
As
Integer
= Rnd() * 50 + 50
With oBarChart
.AutoRefresh =
False
.LicenseeIdentifier =
"PROF"
For k
As
Integer
= 0
To
15
arrSeries(0).Add(p)
p += Rnd() * 10 - 5
If p <
50
Then
p += 25
ElseIf p
> 99
Then
p -= 25
End
If
Next
.Series = arrSeries
.Style =
STYLE2D3D.STYLE2D_LINE
.YAxisLocation =
STYLEYAXISLOCATION.STYLEYAXISLOCATION_RIGHT
.YAxisTitle =
"Y-Axis 2 Title"
.YAxisScaleMode =
SCALEMODE.SCALEMODE_FIXED
.YAxisScaleMinimum
= 0
.YAxisScaleMaximum = 150
.SeriesLegend =
New
String()
{"Profit"}
.ShowValues =
False
End
With
' Add the second chart to current chart and
refresh
Super2D3dGraph1.ChartAdd(oBarChart)
Super2D3dGraph1.AutoRefresh =
True
End
Sub
' Form_Load
End
Class
Result:

|