[Chartjs]-Chart.js How to synchronize pan and zoom in multiple chats

10👍

I figured out how to do this. It’s not a big deal if I know.

Callback function updateChart() should be like this:

        function updateChart() {
            Chart.helpers.each(Chart.instances, function (instance) {
                instance.options.scales.xAxes[0].time.min = leftEnd;
                instance.options.scales.xAxes[0].time.max = rightEnd;              
                instance.update();
            });
        }

Point is that my data is time series data so that scale option should be use “time”.

JSFillde is updated.

Leave a comment