score:0
- hide the original reset button
chart: { resetZoomButton: { theme: { display: 'none' } } }
- take care of the event
buttons: { resetButton: { symbol: 'url(redo_icon.svg)', _titleKey: "resetZoom", y: 20, x: -20, onclick: function () { this.xAxis[0].setExtremes(null,null); this.yAxis[0].setExtremes(null,null) } } }
score:0
We had a similar situation - user zooms, we add a 'save this zoom stage' button, user clicks the button, we save the new min/max time, but now we have to make the reset zoom button disappear.
This code did it and the button returns if the user zooms even further afterwards:
chart.resetZoomButton.hide();
chart.resetZoomButton = chart.resetZoomButton.destroy();
score:1
I just called the button's click event and it worked fine.
given: v_chart is variable for Highcharts chart;
if (typeof v_chart.resetZoomButton !== 'undefined') {
v_chart.resetZoomButton.element.onclick();
}
score:3
If you want to reset the zoom on an external button click then do it as follows:
$("#YourOwnZoomBtnID").click(function(){
$('.highcharts-button').click();
});
If you want to hide the Inbuilt Reset Button of highcharts then you can do it as follows:
xAxis: { categories: xAxisCategories
,events: {
afterSetExtremes: function() {
$('.highcharts-button').hide();
}
}}
jsfiddle example is here: jsfiddle
Thanks Kalyan
score:4
As suggested here
chart.zoom()
But keep in mind that calling chart.zoom()
does not trigger chart.events.selection
event. Which is triggered if you click on "Reset button" manually or programmatically $('.highcharts-button').click();
score:10
Pawel's suggestion of calling
chart.xAxis[0].setExtremes(null,null);
does work, btw, as shown here: http://jsfiddle.net/tvHg6/
However, although the chart zooms out, the resetZoom button is still hanging around, not sure how to hide it. Calling chart.resetZoomButton.hide() hides it, but it does so permanently.
Source: stackoverflow.com
Related Query
- Calling Reset Zoom manually
- highcharts hide zoom reset button, call zoom reset programmatically
- Highcharts chart click event fired on click of the reset zoom button (bug?)
- highcharts how to catch and insert logic in click reset zoom button event
- HighCharts - Set Max and Min values in zoom reset
- Highcharts zoom on 2 charts - Reset zoom issue
- Highcharts-ng reset zoom
- Strange character in the Highstock source code
- Highcharts - Reset zoom in synchronised charts
- Reset zoom doesn't adhere to axis extremes
- highcharts reset zoom button
- Highcharts - show markers on zoom event (selection) and hide on reset zoom. Is it possible?
- Styling HighCharts reset Zoom button with Material UI button
- highcharts how to override reset zoom button event
- high charts xAxis label cannot be display after reset zoom
- How to zoom chart line same as legend hover and reset automatically on button click in highcharts?
- Highcharts reset zoom doesn't center data points
- How to set reset zoom button and title to exactly center of the high charts
- Calling Highcharts export to jpeg but the source is https and exporting is http (security warnings issued by browser)
- Highcharts - Hide the Reset zoom button always
- Highstocks - How to change the default Zoom
- Highcharts - manually trigger hover event on a point
- How do I detect a zoom event in highcharts?
- HighStock : Remove Zoom bar
- Highcharts 'Reset Zoom' after calling setExtremes
- Possible to connect the zoom on two Highcharts graphs?
- Optimize JavaScript DrillDown code
- hide zoom text on rangeSelector
- How can I reset the styles given to series in Highcharts?
- Execute function after zoom highcharts
More Query from same tag
- Highcharts returning error 14
- HighStocks Series Data format
- How do I pass in parameters to the Highcharts pointFormatter callback function
- Scatter chart using HTML and Java Script (makeing y axis starting from zero (upside down) )
- Styling bar colors in Highcharts with a gradient issue
- highcharts: column chart color change based on value
- Per-cell border colors in a highcharts heat map
- Execute a function after rendering of Graph completes
- How to prevent column overlap in Highcharts
- Legend order for proximate layout
- Highcharts - Different Marker for Each Point of Area Plot
- Highcharts Synchronized charts
- Customize Highchart tooltip
- Highstock return to panning after using zoom
- How can I add a text link just below the legend box in highcharts
- How can I get proper object through loop using javascript for Bubble Charts of Highcharts
- Weekly PDF generation using PHP and Highcharts
- (HighCharts) Color reverts on mouseOut after manual mouseOver
- Why are there disabled buttons in HighStock Range Selector?
- Rails and Highcharts
- How to make the Y Axis values not start from 0 in highcharts? How to display forcefully display the last category data on X axis in HighCharts ?
- Highchart with scaled images in column bars?
- How to web scraping Highcharts values?
- Pie Chart is not showing correct value due to asynchronous data retrieve in Angular JS
- How to create data in Json format for highcharts
- Can i add two axis in a spiderweb highcharts and click x-axis label navigate to another page?
- How to display precise value on tooltip on moving a cursor in highcharts
- Bar chart for displaying min/max/avg
- Use comma values as datapoints within a PieChart
- Primary and Secondary yAxis zero on different levels