[Chartjs]-Pause chart.js horizontal scroll

2👍

You need to access the property of the actual chart, instead of updating the config.

Try changing config.options.scales.xAxes[0].realtime.pause = this.checked; to window.myChart.chart.options.plugins.streaming.pause = this.checked; in the pause checkbox’s click listener.

document.getElementById('pause').addEventListener('click', function() {
    
   window.myChart.chart.options.plugins.streaming.pause = this.checked;
   window.myChart.update({duration: 0});
   document.getElementById('pauseValue').innerHTML = this.checked;
                
    window.myChart.update();
})

Leave a comment