Example 30: One gauge, two needles
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
Dim sf
As
New
SeriesFactory
sf.AddValue(20)
sf.AddValue(45)
With
Super2d3dGraph1
.LicenseeIdentifier =
"PROF"
.Title = "One gauge, two needles"
.Style =
Super2d3dGraphLibrary.STYLE2D3D.STYLE2D_GAUGE
.BackStyle =
STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR
.Series = sf.Series
' Datatable setup
.DataTableText =
"Data gathered on 17/02/2008 15:34:12"
.ItemsLegend =
New
String()
{"Factor
1",
"Factor 2"}
.ShowItemsLegend =
True
.ShowLegend =
False
.SeriesLegend =
New
String()
{"Sensors"}
' Scale setup
.YAxisScaleMaximum
= 50
.YAxisScaleMinimum
= 0
.YAxisScaleMode =
SCALEMODE.SCALEMODE_FIXED
.YAxisNumericFormat
= 0
' Gauge setup
.GaugeBackStyle =
New
SolidBrush() {New
SolidBrush(Color.White)}
.GaugeBorderStyle =
New Pen()
{New
Pen(Color.Black, 3)}
.GaugeBigTickStyle =
New Pen()
{New
Pen(Color.Black, 2)}
.GaugeSmallTickStyle =
New Pen()
{New
Pen(Color.Black, 1)}
.GaugeCentralCircleBackStyle =
New
SolidBrush() {New
SolidBrush(Color.Gray)}
Dim p
As Pen =
New
Pen(Color.Red, 3)
p.EndCap = Drawing2D.LineCap.ArrowAnchor
.SeriesColor =
New
Color() {Color.Red}
.GaugeNeedleStyle =
New
Pen() {p}
.RefreshChart()
End
With
End
Sub
End
Class
Result:

|