highcharts hide zoom reset button, call zoom reset programmatically

TSG picture TSG · Feb 22, 2013 · Viewed 20.6k times · Source

I have a nice chart in highcharts that the user can zoom into. I really don't like the built-in ZOOM RESET button, and would like to add my own custom zoom reset button into a nav bar already present.

So my questions are: 1. Is there a way to hide the default highcharts ZOOM RESET button? 2. Is there a method/function I can call to perform the ZOOM RESET? (I can call that from my own button click)

Answer

Ricardo Alvaro Lohmann picture Ricardo Alvaro Lohmann · Feb 22, 2013

You can pass resetZoomButton as display: none and call zoomOut.

chart: {
    resetZoomButton: {
        theme: {
            display: 'none'
        }
    }
}

$('#resetZoom').click(function() {
    chart.zoomOut();
});

<input type="button" value="reset zoom" id="resetZoom"/>

Demo