0👍
You may want to add delay at streaming plugin, the config will look something like:
scales: {
x: {
type: 'realtime', // x axis will auto-scroll from right to left
realtime: { // per-axis options
delay: 1000, // delay of 1000 ms, so upcoming values are known before plotting a line
pause: false, // chart is not paused
ttl: undefined, // data will be automatically deleted as it disappears off the chart
}
},
I have tested this on your code, and it seems to work as expected, you may want to tune some parameters as needed.
- Chartjs-TypeError React-Chartjs After Upgrading to Chart.js v3
- Chartjs-How to categorise resultset from Stored Procedure in Asp.Net Core Razor pages for rendering graphs using chartjs
Source:stackexchange.com