InsertSeries

Description

Inserts a series in a graph at the specified position. Existing series in the graph are renumbered to keep the numbering sequential.

Applies to

Graph controls in windows and user objects. Does not apply to graphs within DataWindow objects, because their data comes directly from the DataWindow.

Syntax

controlname.InsertSeries ( seriesname,  seriesnumber )

Argument

Description

controlname

The name of the graph in which you want to insert a series.

seriesname

A string containing the name of the series you want to insert. The series name must be unique within the graph.

seriesnumber

The number of the series before which you want to insert the new series. To add the new series at the end, specify 0.


Return value

Integer. Returns the number of the series if it succeeds and -1 if an error occurs. If the series named in seriesname exists already, it returns the number of the existing series. If any argument's value is null, InsertSeries returns null.

Usage

Series names are unique if they have different capitalization.

Equivalent syntax

If you want to add a series to the end of the list, you can use AddSeries instead, which requires fewer arguments.

This statement:

gr_data.InsertSeries("Costs", 0)

is equivalent to:

gr_data.AddSeries("Costs")

Examples

These statements insert a series before the series named Income in the graph gr_product_data:

integer SeriesNbr
 
// Get the number of the series.
SeriesNbr = FindSeries("Income")
gr_product_data.InsertSeries("Costs", SeriesNbr)

See also

AddData

AddSeries

FindCategory

FindSeries

InsertCategory

InsertData