[Chartjs]-How can I make streaming chart with react?

1👍

You need to update the data in the argument you get in the onRefresh function like so:

realtime: {
  onRefresh: function(chart) {
    chart.data.datasets[0].data.push({
      x: Date.now(),
      y: Math.random() * 100,
    });
  },
  delay: 2000,
},

Leave a comment