How I can reset zoom (display the whole graph) of simple line chart programatically? I can't find a suitable method in the documentation.
I use Ext.chart.interactions.CrossZoom if its metter.
How I can reset zoom (display the whole graph) of simple line chart programatically? I can't find a suitable method in the documentation.
I use Ext.chart.interactions.CrossZoom if its metter.
There is an undocumented
undoZoom
method in the CrossZoom class. You can use it like so:Edit
The cross zoom interaction keeps the history zoom in a
zoomHistory
property. TheundoZoom
method goes back, one step/zoom at a time, along the zoom history.Based on
undoZoom
method, I've created anresetZoom
method that directly resets the chart to its initial zoom:Here is a working fiddle: https://fiddle.sencha.com/#view/editor&fiddle/264t
Another Edit
As @SergeyNovikov has noted in the comments, and as you can see from the
undoZoom
method andresetZoom
override, it all comes down to the axis' setVisibleRange method. So you can also directly use it with min/max values as arguments to reset the zoom.