Namespace: GlobFX.SwiffChartGenerator
Assembly: GlobFX.SwiffChartGenerator (in GlobFX.SwiffChartGenerator.dll)
Set series values from data stored in a single-dimension array.
Public Sub SetSeriesValuesFromArray( index As Integer, values As Array )
public void SetSeriesValuesFromArray( int index, Array values );
The data stored in the array must be numerical values.
If the index argument refers to a series that does not exist in the chart object, the series is created.
The following code shows how to store the series and categories of the table below using the SetSeriesValuesFromArray method. This table has two series named "Year 2006" and "Year 2007". The categories are "North America", "South America", "Europe", "Middle East" and "Asia".
|
||||||||||||||||||
Dim myArray(4) As String myArray(0) = "North America" myArray(1) = "South America" myArray(2) = "Europe" myArray(3) = "Middle East" myArray(4) = "Asia" ' Fill the chart with the categories stored in the myArray variable chart.SetCategoriesFromArray(myArray) ' Add the first series "Year 2006" Dim myValues(4) As Double myValues(0) = 12.0 myValues(1) = 7.5 myValues(2) = 11.3 myValues(3) = 9.2 myValues(4) = 5.3 ' Fill the first series with the data stored in the myValues variable chart.SetSeriesCaption(0, "Year 2006") chart.SetSeriesValuesFromArray(0, myValues) ' Do the same way for the second series "Year 2007"
string[] myArray= new string[5]; myArray[0]= "North America"; myArray[1]= "South America"; myArray[2]= "Europe"; myArray[3]= "Middle East"; myArray[4]= "Asia"; // Fill the chart with the categories stored in the myArray variable chart.SetCategoriesFromArray(myArray); // Add the first series "Year 2006" double[] myValues= new double[5]; myValues[0]= 12.0; myValues[1]= 7.5; myValues[2]= 11.3; myValues[3]= 9.2; myValues[4]= 5.3; // Fill the first series with the data stored in the myValues variable chart.SetSeriesCaption(0, "Year 2006"); chart.SetSeriesValuesFromArray(0, myValues); // Do the same way for the second series "Year 2007"
SeriesCount Property | SetSeriesValuesFromString Method | SetSeriesCaption Method | GetSeriesValue Method
Applies To: Chart Object