score:1

Accepted answer

This is because you are pushing 20 data points in onRefresh() every second, but only one data point out of 20 points is new and the rest are already inserted ones. This plugin doesn't dedup the data even if the same data with the same timestamp exists, so you see the line iterating the same points over and over.

A workaround would be to store the latest timestamp in your array when it is inserted, and to filter out the older data in the next onRefresh call so that only new data is pushed to chart.data.datasets[0].data.


Related Query

More Query from same tag