Home › forums › Using CanvasJS › Sync multiple charts (more than 2)
Tagged: Charts, multiple, sync, synchronization
I saw in the CanvasJS docs (and in the jsfiddle ) that syncing multiple charts is possible and I am able to have synchronization for 2 charts. My question is, how do I sync multiple charts if there are more than 2? For example, if I have 5 or 6 different types of charts on one page, how can I sync their crosshair to show tooltips and enable/disable “zoom” and “pan” on all of them? How do I properly loop over them? Thanks in advance.
Syncing tooltip and crosshair is not available as an inbuilt feature as of now. The JSFiddle provided shows a work-around by simulating mouse events on second chart based on mouse movement on first chart. However, you can sync zooming/panning across n-number of charts with the help of rangeChanged event as briefed in this tutorial.
If you are still facing issue in synchronizing zooming/panning across multiple charts, kindly create JSFiddle reproducing the issue and share it with us so that we can look into your code, understand the scenario better and help you resolve.
JS Fiddle: https://jsfiddle.net/VladimirDev/51fkgz2r/35/
As of now, aligning axisY of multiple charts on zooming is not available as an inbuilt feature. However, you can achieve it with the help of rangeChanged event and axis set method. Please take a look at this updated JSFiddle which gives an idea on the same.
You must be logged in to reply to this topic.