Super 2d/3d Graph Library

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


Example 45: Gauge with range colors


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(75)   ' value of gauge's needle

  With Super2d3dGraph1
    .LicenseeIdentifier =
"PROF"
    .Title =
"Gauge example with range colors"
    .Style = Super2d3dGraphLibrary.STYLE2D3D.STYLE2D_GAUGE
    .BackStyle = STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR
    .Series = sf.Series

    ' Datatable setup
    .ShowDataTable =
False
    .ShowLegend =
False

    ' Scale setup
    .YAxisScaleMaximum = 100
    .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)}

    ' Needle style
    Dim p As Pen = New Pen(Color.Black, 6)
    p.EndCap = Drawing2D.LineCap.ArrowAnchor
    .GaugeNeedleStyle =
New Pen() {p}

    ' Range colors
    Dim rangeColors(0) As ArrayList
    rangeColors(0) =
New ArrayList
    rangeColors(0).Add(
New Object() {0, 30, Color.FromArgb(200, Color.Red)})
    rangeColors(0).Add(
New Object() {30, 50, Color.FromArgb(200, Color.Green)})
    rangeColors(0).Add(
New Object() {50, 100, Color.FromArgb(200, Color.Yellow)})
   
.GaugeRangeColors = rangeColors

    .RefreshChart()

  End With

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