InsertSeries
PowerScript function
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
|
1 |
controlname.InsertSeries ( seriesname, seriesnumber ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph in which you want to insert a |
|
seriesname |
A string containing the name of the series you want to |
|
seriesnumber |
The number of the series before which you want to insert |
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:
|
1 |
gr_data.InsertSeries("Costs", 0) |
is equivalent to:
|
1 |
gr_data.AddSeries("Costs") |
Examples
These statements insert a series before the series named Income in
the graph gr_product_data:
|
1 2 3 4 5 |
integer SeriesNbr // Get the number of the series. SeriesNbr = FindSeries("Income") gr_product_data.InsertSeries("Costs", SeriesNbr) |
See also