chartjs-plugin-streaming icon indicating copy to clipboard operation
chartjs-plugin-streaming copied to clipboard

Scroll faster that plotting

Open bUxEE opened this issue 4 years ago • 0 comments

I am passing the timestamp of the data in the x value in each update.

...options..
realtime: {
  delay: 1000,
  refresh: 4,
  duration: 20000,
  ttl: 60000,
  pause: false,
  onRefresh: (chart) => {
     this.addData(chart)
  }
}
...

//this.tmpData is an array populated by websocket messages
...methods...
addData(chart) {
  let obj = { x:  this.tmpData[0].timestamp, y:  this.tmpData[0].ecg };
  chart.data.datasets[0].data.push(obj);
}
...

The problem is that the chart scroll is faster than the data plotted.

bUxEE avatar Jul 10 '20 16:07 bUxEE