Super 2d/3d Graph Library

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


Example 17: Labels - SeriesLegend vs ItemsLegend

 

This is a quick SeriesLegend and ItemsLegend properties sample:

  • SeriesLegend is used to group a list of values by the same color.

  • ItemsLegend is used to assign a label to each group of values of different series.

Take a look at the following sample:

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 myData(2) As ArrayList

   ' Some quick random data...
   myData(0) =
New ArrayList
  
myData(0).Add(15)
  
myData(0).Add(17)
  
myData(0).Add(24)
   myData(1) = New ArrayList
  
myData(1).Add(5)
  
myData(1).Add(23)
  
myData(1).Add(28)
   myData(2) = New ArrayList
  
myData(2).Add(12)
  
myData(2).Add(18)
  
myData(2).Add(19)

   With Super2D3dGraph1
      .LicenseeIdentifier = "PROF"

      ' General appearance
      .Title =
"PETS SOLD!"
      .Series = myData
      .ShowDataTable =
False
      .Style = STYLE2D3D.STYLE2D_ACUM_FIXED
      .WallsBackStyle =
             STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_TRANSPARENT
      .BackStyle =
          STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR_INVERTED

      ' Yaxis look & feel
      .YAxisTitle =
"Units"
      .YAxisDividersCount = 5
      .YAxisNumericFormat =
"0"   ' <- No decimals

      ' Values look & feel
      .ValuesFormat =
"0"   ' <- No decimals
      .ValuesBackColor = Color.LightSkyBlue

      ' Legend look & feel
      .Thickness = 90
      .SeriesLegend =
New String() {"Cats", "Dogs", "Birds"}
      .SeriesColor =
New Color()
                        {Color.Yellow, Color.Brown, Color.Cyan}
      .LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_TOP_CENTER
      .LegendText =
""   ' <- Hide legend title
      .ShowLegend =
True

      ' X-Axis look & feel
      .ItemsLegend =
New String()
                 {"October 2006", "November 2006", "December 2006"}
      .ShowItemsLegend =
True
      .XAxisTitle =
"Month"
      .ShowXAxis =
True

      .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