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
undoZoommethod in the CrossZoom class. You can use it like so:Edit
The cross zoom interaction keeps the history zoom in a
zoomHistoryproperty. TheundoZoommethod goes back, one step/zoom at a time, along the zoom history.Based on
undoZoommethod, I've created anresetZoommethod 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
undoZoommethod andresetZoomoverride, 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.