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
- How to customize the label for navigator in highstock
- R highcharter get data from plots saved as html
- How to import data from google spreadsheet in Highmaps map bubble
- Highcharts - Export with background color
- Highcharts - format date for x-axis as well as autoscale (data from mysql)
- Unable to assert axis label text in highcharts using Geb
- How do you increase the performance of highcharts chart creation and rendering
- Highcharts: Can I export to the user an Excel or CSV of the raw data driving the chart?
- Hide Scrollbar when Printing highchart from export menu
- budling and download json files for highcharts
- How to reduce height of cell in highcharts
- Wkhtmltopdf fails to printing SVG path (highchart)
- Highcharts datalabel 'callout' shape not working for donut chart
- HighCharts - hide date on x-axis and have only hours and minutes
- How to make 3 levels drilldown plot in R highcharter (possible other packages)
- Stacked Bar Highcharts how to show the values
- Building dynamic HighCharts and image Highcharts with (mostly) one codebase?
- highcharts link series such that turn one off turns off the other
- How to fetch data into highchart in react app
- Highcharts gantt - show multiple xAxis rows, one for year and one for month
- Issue while Dynamically Modifying yAxis Extremes in Highchart
- Highcharts (highcharts-ng) with ng-repeat worked, But need to pass the data for each chart from the attributes
- Highcharts are not redraw
- Loading variwide chart from Highcharts library in Angular 2+
- How to set the x-axis to start at the bottom of the chart in highchart
- HIGHCHARTS: drilldown.js changes pie chart label color
- Highcharts lang with ngx-translate
- Highcharts Gantt milestone series
- can't zoom in and zoom out of a HIChart's Line/Bar chart in Xcode Simulator using Swift 5.0
- Highcharts Gantt does not show ALL rows that are empty