I have to listen to some kind of zoom events to get the current scale of the zoom. Also it would be helpful to have a function to set the zoom. Is there any (internal) function already?
I would like to have something like:
chart.zoom.onzoom = function(x1, x2) {};
chart.zoom.setzoom(x1, x2);
Hi, onzoom callback is already implemented in the latest code. You can set this callback when init like this:
...
zoom: {
enabled: true,
onzoom: function (domain) {
// do something with domain, which is the domain after zoomed
}
},
...
And I implemented zoom API, so now it's possible to zoom programmatically like:
chart.zoom([4, 10]); // then, the chart will be zoomed to the range from 4 to 10
Could you try these? Thanks.
Wonderful! That is exactly what I was looking for.
~ Thank you
Most helpful comment
Hi,
onzoomcallback is already implemented in the latest code. You can set this callback when init like this:And I implemented
zoomAPI, so now it's possible to zoom programmatically like:Could you try these? Thanks.