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

object.SetSeriesCaption( index, caption )

Arguments

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

Remarks

By default, a new data series added to a chart with the method AddSeries has no caption.

If the index argument refers to a series that does not exist in the chart object, the SetSeriesCaption method raises an out of bounds error.

Use the AddSeries Method to create a new empty series.

JScript Sample Code

The following JScript code illustrates use of the GetSeriesCaption method.

var values= new Array(3);

values[0] = 10.5;
values[1] = 12.4;
values[2] = 15.9;

chart.AddSeries();
chart.SetSeriesValuesFromArray(0, values);
chart.SetSeriesCaption(0, "Turnover in Million dollars");

chart.LoadStyle("C:\\myStyle.scs");
chart.ExportAsResponse();

See Also

GetSeriesCaption Method | GetSeriesValue Method | GetSeriesCount Method

Applies To: Chart Object