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.
Controls
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 |
<span>controlname</span>.<span>InsertSeries</span> ( <span>seriesname</span>, <span>seriesnumber</span> <span></span>) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph in which you want |
|
seriesname |
A string containing the name of the series |
|
seriesnumber |
The number of the series before which |
Return Values
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 |
integer SeriesNbr |
|
1 |
|
1 |
// Get the number of the series. |
|
1 |
SeriesNbr = FindSeries("Income") |
|
1 |
gr_product_data.<span>InsertSeries</span>("Costs", SeriesNbr) |