Specifies the color for a series defined by its index in a chart.

void object.SetSeriesValueColor( int index, int valueindex, string color )

Arguments

object
Required. A Chart object.
index
Required. An integer value that specifies the zero-based index of the series in the chart object.
valueindex
Required. An integer value that specifies the zero-based index of the value in the series specified by index.
color
Required. A string that specifies the color.

Remarks

By default, a new data series added to a chart takes its colors from the chart style.

If the index argument refers to a series that does not exist in the chart object, the series is created.


The color argument can be specified:

If the color argument is an empty string, the default original color is restored.
If the color argument cannot be recognized, the black color is used.

When generating several charts using a single chart object, the ClearAll method can be used between each generated charts.

JSP Sample Code

The following JSP code illustrates use of the SetSeriesValueColor method.

float[] values= new float[5];

// Define the series #0
values[0] = 10.5f;
values[1] = 12.4f;
values[2] = 15.9f;
values[3] = 17.1f;
values[4] = 18.2f;
chart.SetSeriesValuesFromArray(0, values);

chart.LoadStyle("column/Honolulu");

// Set the color of the 3rd value of series #0
chart.SetSeriesValueColor(0, 2, "limegreen");

chart.ExportAsResponse();

See Also

SetSeriesColor Method | ClearAll Method | Predefined Colors Reference

Applies To: Chart Object