Obtains the number of a series in a graph when you know the series’ name.
Graph controls in windows and user objects, and graphs in DataWindow controls
controlname.FindSeries ( { graphcontrol, } seriesname )
Argument |
Description |
---|---|
controlname |
The name of the graph containing the series for which you want the number, or the name of the DataWindow control containing the graph |
graphcontrol (DataWindow control only) |
(Optional) A string whose value is the name of the graph in the DataWindow control containing the series |
seriesname |
A string whose value is the name of the series for which you want the number |
Integer. Returns the number of the series named in seriesname in the graph controlname, or if controlname is a DataWindow control, in graphcontrol. If an error occurs, FindSeries returns -1. If any argument’s value is null, FindSeries returns null.
Most of the series manipulation functions require a series number, rather than a name. However, when you delete and insert series, existing series are renumbered so that the series are numbered consecutively. Use FindSeries when you know only a series’ name or when the numbering may have changed.
These statements store the number of the series in the graph gr_product_data that was entered in the SingleLineEdit sle_series in SeriesNbr:
integer SeriesNbr
SeriesNbr = &
gr_product_data.FindSeries(sle_series.Text)
These statements obtain the number of the series named PCs in the graph gr_computers in the DataWindow control dw_equipment and store it in SeriesNbr:
integer SeriesNbr
SeriesNbr = &
dw_equipment.FindSeries("gr_computers", "PCs")