| RMC_SetSeriesDataRange function. | ||
| Sets the range within the data block of a series | ||
| Syntax | ||
| nResult (LONG) = RMC_SetSeriesDataRange( ByVal nCtrlId (LONG), ByVal nRegion (LONG), ByVal nSeries (LONG), ByVal nFirst (LONG), ByVal nLast (LONG) ) | ||
| Parameter | ||
| nCtrlId (LONG) | ||
| Unique ID of the chart control, to which the series belongs. | ||
| nRegion (LONG) | ||
| Index of the region, to which the series belongs. | ||
| nSeries (LONG) | ||
| Index of the series. | ||
| nFirst (LONG) | ||
| Index of the first data value within the data block, which shall be included, first data value has index 1. See also Remarks! | ||
| nLast (LONG) | ||
| Index of the last data value within the data block, which shall be included. See also Remarks! | ||
| Return value | ||
| 0 | ||
| No error, function succeeded. | ||
| RMC_ERROR_CTRLID | ||
| Wrong control ID (0 or no chart with this control ID was found). | ||
| RMC_ERROR_WRONGREGION | ||
| The region index is inexistent in the chart control. | ||
| RMC_ERROR_SERIESINDEX | ||
| The series index is not valid (No series with this index exists in this region). | ||
| RMC_ERROR_NODATA | ||
| The series has no data. | ||
| RMC_ERROR_RANGE | ||
| The chart type of the series does not support setting the data range. See Remarks | ||
| Remarks | ||
|
With this function scrolling through huge data amount is very easy. Instead
of repeatedly adding the portion of data you want to show (e.g. with RMC_SetSeriesData()),
you can add all data at once, then setting the range of the data to be shown while your user scrolls through the chart.
NOTE:
| ||
| Example | ||
i = RMC_AddLineSeries(%ID_RMC,1,aData(0),1000) ' Add a line series with 1000 data points i = RMC_SetSeriesDataRange(%ID_RMC1,1,1,1,50) ' Include only the first 50 data points into the chart i = RMC_Draw(%ID_RMC1) ' Draw the chart initially ... ... ... ' later, for example when the user clicked a scroll bar: i = RMC_SetSeriesDataRange(%ID_RMC1,1,1,51,100) ' Show the next 50 data points ... i = RMC_Draw(%ID_RMC1) ' ... and redraw the chart | ||