CPlotView:SetIndex
The SetIndex method changes the current plot series index to a specified value.
bSuccess = CPlotView:SetIndex( nSeries ) |
nSeries is the series index in the range 1 to Count.
bSuccess is the returned success code. On success it is true, otherwise false.
A plot window shows all series simultaneously in over-plot mode, or it displays only the current series in animation mode. Therefore, if the plot window is in over-plot mode, changing the current series does not affect the appearance of the window.
The following script plots some points in different series of a CPlotView. It then sets the index back to the first series and returns some information about the current series:
|
-- create a CPlotView |
|
-- add a point to the data array |
-- |
-- add 99 more points |
|
-- plot 100 points in a new plot window |
|
-- empty all the points |
|
-- add 1 point to a new data array |
|
-- plot the point as a new series |
|
-- add 1 point to a new data array |
|
-- plot the point as a new series |
|
-- go back to series 1 |
|
-- number of plot series |
|
-- index of current series |
|
-- result: n=3, cur=1 |