nagix / chartjs-plugin-streaming

Chart.js plugin for live streaming data
MIT License
515 stars 130 forks source link

Chartjs Line chart streaming stops when browser tab is not active #191

Open CRajiv opened 1 year ago

CRajiv commented 1 year ago

Chart stops streaming when browser tab is not active. Here is picture of my chart and code. You can see that in below image, very few datapoints are added into the chart when browser tab is not active ,and once the tab is active then the chart starts to do streaming as per configured refresh time. Please help me on this.

### Screenshot

ChartJS_Delay

ReactJS Code

scales: { x: { type: "realtime", ticks: { color: "#cdd5d9", }, realtime: { refresh: configData.Refreshtimer, // onRefresh callback will be called every 100 ms // onrefresh callback to update datasets onRefresh: function () { currObj = { x: Date.now(), y: Math.random(), }; chartRef.current.data.datasets[0].data.push(currObj); } }, }, },

alexbodn commented 1 year ago

it seems to be a feature of the browser that slows down on inactive tabs. it should be configurable per tab.