Set categories names from data stored in a single-dimension array.
void object.SetCategoriesFromArray( string[] categories )
The following JSP code shows how to store the series and categories of the table below using the SetCategoriesFromArray method. This table has two series named "Year 2006" and "Year 2007". The categories are "North America", "South America", "Europe", "Middle East" and "Asia".
|
||||||||||||||||||
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" float[] myArray2= new float[5]; myArray2[0]= 12.0f; myArray2[1]= 7.5f; myArray2[2]= 11.3f; myArray2[3]= 9.2f; myArray2[4]= 5.3f; // Fill the first series with the data stored in the myArray2 variable chart.SetSeriesCaption(0, "Year 2006"); chart.SetSeriesValuesFromArray(0, myArray2); // Do the same way for the second series "Year 2007"
SetCategoriesFromString Method | GetCategory Method
Applies To: Chart Object