Namespace: GlobFX.SwiffChartGenerator
Assembly: GlobFX.SwiffChartGenerator (in GlobFX.SwiffChartGenerator.dll)
Retrieves the number of series values and categories in the chart object.
Public ReadOnly Property ValuesCount As Integer
public int ValuesCount { get; }
An integer value containing the number of values per series. This number is also the number of categories.
The following code illustrates use of the ValuesCount property.
Dim values_1(1) As Integer Dim values_2(1) As Integer values_1(0) = 10 values_1(1) = 20 values_2(0) = 100 values_2(1) = 200 values_2(2) = 300 chart.SetSeriesValuesFromArray(0, values_1) ' count1 is now equal to 2 Dim count1 As Integer = chart.ValuesCount chart.SetSeriesValuesFromArray(1, values_2) ' count2 is now equal to 3 Dim count2 As Integer = chart.ValuesCount Dim categories(3) As String categories(0) = "Cat 1" categories(1) = "Cat 2" categories(2) = "Cat 3" categories(3) = "Cat 4" chart.SetCategoriesFromArray( categories ) ' count3 is now equal to 4 Dim count3 As Integer = chart.ValuesCount Me.Response.Write( "Count 1= " + count1 + "<br>" ) Me.Response.Write( "Count 2= " + count2 + "<br>" ) Me.Response.Write( "Count 3= " + count3 + "<br>" )
int[] values_1= new int[2]; int[] values_2= new int[3]; values_1[0] = 10; values_1[1] = 20; values_2[0] = 100; values_2[1] = 200; values_2[2] = 300; chart.SetSeriesValuesFromArray(0, values_1); // count1 is now equal to 2 int count1= chart.ValuesCount; chart.SetSeriesValuesFromArray(1, values_2); // count2 is now equal to 3 int count2= chart.ValuesCount; string[] categories= new string[4]; categories[0]= "Cat 1"; categories[1]= "Cat 2"; categories[2]= "Cat 3"; categories[3]= "Cat 4"; chart.SetCategoriesFromArray(categories); // count3 is now equal to 4 int count3= chart.ValuesCount; this.Response.Write("Count 1= " + count1 + "<br>"); this.Response.Write("Count 2= " + count2 + "<br>"); this.Response.Write("Count 3= " + count3 + "<br>");
The result displayed in the Web Browser will be:
Count 1= 2 Count 2= 3 Count 3= 4
SetSeriesValuesFromString Method | SetSeriesValuesFromArray Method | SetCategoriesFromString Method | SetCategoriesFromArray Method | SeriesCount Property
Applies To: Chart Object