Add or change data for a PtMTrend widget
void PtMTrendAddData( PtWidget_t *widget, unsigned graph_no, const int *newdata, unsigned nsamples ); void PtMTrendChangeData( PtWidget_t *widget, unsigned graph_no, int const *newdata, unsigned last_sample, unsigned nsamples );
PtMTrendAddData() lets you add data for a PtMtrend, while PtMTrendChangeData() lets you change existing data.
The newdata array is ordered with the oldest sample at newdata, and the newest at newdata[nsamples - 1]. The oldest sample to be replaced has an index of last_sample + nsamples - 1;
The samples in the trend are replaced as follows:
If last_sample + nsamples - 1 is outside the range of samples for the widget, some initial portion of the new data is discarded.