Highcharts 'Reset Zoom' after calling setExtremes
highcharts
Solution
Just had a look around the HighCharts source code, it looks like this may work out for you:
chart.showResetZoom();
Also, in order for the button to work correctly, you should use axis.zoom instead of setting the extremes:
axis.zoom(newMin,newMax);
Let me know if it works!
Problem
I am using setExtremes to zoom in on detail in a chart, as well as allowing the user to zoom 'x,y' by selecting in the chart. When the user zooms, they get a 'reset zoom' button, however when I call setExtremes, I don't. Is there a way for me to force the 'reset zoom' button to appear programatically ? UPDATE: calling ``` if( !chart.resetZoomButton ) { chart.showResetZoom(); } ``` inside the afterSetExtremes event handler makes the button appear, but clicking it doesn't do anything. UPDATE: Rather than calling setExtremes, I've changed to calling chart.xaxis[0].zoom(minx, maxx); chart.yaxis[0].zoom(miny, maxy); chart.redraw(); This has the same affect as the user zoomin in by selecting on the chart.