WithChartItems (AddSeries)

Adds a new series to a chart area in the currently initialised chart definition.

The new series will include a single data point. For information on adding more data points, refer to Creating a Series Data Point and WithChartItems (AddDataPoint).

Syntax

WithChartItems( InstructionType, SeriesName, ChartArea, DataPointXInfo, DataPointYInfo, SeriesEnabled );

Parameters

Parameter Name Type Description Optional? Default Value
InstructionType Integer or String Must be set to either the integer 4 or the string "AddSeries". No n/a
SeriesName String The name to give the new series. No n/a
ChartArea String The name of the chart area to which the new series should be associated. No n/a
DataPointXInfo String An X-axis value to add to the initial data point in the series. If not used, the data point will have no X-axis value. Yes ""
DataPointYInfo String A comma-separated list containing one or more Y-axis values to add to the initial data point. Since only certain chart types allow multiple Y-axis values, attempting to provide them with an incompatible chart type will cause an error. If not used, the data point will have no Y-axis value. Yes ""
SeriesEnabled Boolean Determines whether the new series should start out as enabled. Yes 1/True

If neither the DataPointXInfo or DataPointYInfo parameters are given values, the new data point will be empty. An empty data point will be overwritten if further data points are added to the same series.

Output

If successful, the function will return the name of the series at the specified index; otherwise, it will return an empty string.