CPlotView:CountSeriesPoints
The CountSeriesPoints method returns the number of points in a plot series of the CPlotView. If the series is not specified, then the current series is used.
nPoints = CPlotView:CountSeriesPoints( series=nil ) |
series is the index of the plot series, in the range 1 to CountSeries. If not specified or nil or 0, the current plot series is used.
On success, this method returns nPoints > 0.
On failure, this method returns 0.
Note that there are two protocols for adding data to a CPlotView: adding individual points from the class data matrix or adding data from the rows of a CMatrix. If using the CMatrix method, note that this protocol plots all point between the minimum and maximum column indices in the row. Since the CMatrix is sparse, the number of points actually stored in the row may be smaller than the number of points in the plot series. See the second example, below.
Example 1. The following script plots some points in 2 plot series of a CPlotView. It then returns the number of points plotted in the first series:
|
-- create a CPlotView |
|
-- add a point to the plot data |
|
-- add 99 more points |
|
-- plot 100 points in a new plot window |
|
-- empty all the points |
|
-- add 1 point to the plot data |
|
-- plot the point as a new series |
|
-- points in series 1 |
|
-- result: n1 = 100 |
|
|
Example 2. The script below shows how the sparse properties of the CMatrix result in more points being plotted than are stored in the CMatrix:
|
-- create a new CPlotView |
|
-- create a CMatrix |
|
-- add point at row 4, column 12. |
|
-- add point at row 4, column 20. |
|
-- plot CMatrix row 4 (entered as 4 to 4) |
|
-- number of points plotted |
|
-- result: nSeries = 9 |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.