Set series values from data stored in a single-dimension array.

void object.SetSeriesValuesFromArray( int index, String[] values )
void object.SetSeriesValuesFromArray( int index, int[] values )
void object.SetSeriesValuesFromArray( int index, float[] values )
void object.SetSeriesValuesFromArray( int index, double[] values )

Arguments

object
Required. A Chart object.
index
Required. An integer value that specifies the zero-based index of the series in the chart object.
values
Required. A single-dimension array containing the series values as elements (String, int, float or double).

Remarks

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.

JSP Sample Code

The following JSP 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".

  North America South America Europe Middle East Asia
Year 2006 12 7.5 11.3 9.2 5.3
Year 2007 14 9.9 13.1 11.5 4.9

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[] myValues= new float[5];
myValues[0]= 12.0f;
myValues[1]= 7.5f;
myValues[2]= 11.3f;
myValues[3]= 9.2f;
myValues[4]= 5.3f;

// 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"

See Also

GetSeriesCount Method | SetSeriesValuesFromString Method | SetSeriesCaption Method | GetSeriesValue Method

Applies To: Chart Object