score:5
Accepted answer
The jsfiddle from jsfiddle.net/E6GHC/1 seems to answer the question partially (though I'm still surprised there is no event callback for this)
The setExtremes event on the xaxis does the job:
xAxis: {
events: {
setExtremes: function(e) {
console.log(this);
if(typeof(e.rangeSelectorButton)!== 'undefined')
{
alert('count: '+e.rangeSelectorButton.count + 'text: ' +e.rangeSelectorButton.text + ' type:' + e.rangeSelectorButton.type);
}
}
}
}
score:3
This http://jsfiddle.net/E6GHC/5/ should do what you want:
xAxis: {
events: {
setExtremes: function(e) {
if(typeof(e.rangeSelectorButton)!== 'undefined') {
var c = e.rangeSelectorButton.count;
var t = e.rangeSelectorButton.type;
var btn_index = null;
if(c == 1 && t == "month"){
btn_index = 0;
} else if(c == 3 && t == "month"){
btn_index = 1;
} else if(c == 6 && t == "month"){
btn_index = 2;
} else if(t == "ytd"){
btn_index = 3;
} else if(c == 1 && t == "year"){
btn_index = 4;
} else if(t == "all"){
btn_index = 5;
}
// Store btn_index in a cookie here and use it
// to initialise rangeSelector -> selected next
// time the chart is loaded
alert(btn_index);
}
}
}
}
score:3
chart event: redraw can get the display range. Code is tested in highstock 3.10
events: {
redraw: function(event) {
console.log('==============> chart redraw <==============');
console.log(
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.currentTarget.xAxis[0].min),
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.currentTarget.xAxis[0].max)
);
// log the min and max of the y axis
console.log(event.currentTarget.yAxis[0].min, event.currentTarget.yAxis[0].max);
}
}
Source: stackoverflow.com
Related Query
- Get the currently selected range from RangeSelector in Highstock
- Get the currently selected rangeSelector from an event unrelated to the chart
- custom ticks based on selected range from rangeSelector in Highstock
- highstock selected rangeSelector is computed from the current end date in the slider and not from the start date
- How can I get the navigator selection from a Highstock chart?
- Strange character in the Highstock source code
- How can i use Highstock rangeSelector get the yAxis Max_value and Min_Value
- Highcharts get table from range selected only
- Highstock rangeSelector from days in the future
- Highcharts Pie charts get the selected pie id
- Customizing the Stockchart range selector buttons from HighCharts library in GWT (and Javascript in general)
- Highstock: Remove the word "Zoom" from the rangeSelector
- Highcharts (Highstock) how to manually set the navigator selected range
- How to extract the data from highstock chart
- get values of date-input-boxes from rangeSelector
- How do I prevent Highstock right range handle keep slipping off the max value when adding data
- How to get the highlighted point from shared tooltip formatter, Highcharts
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Get the JSON encode result from the Controller to View
- How to get selected date from highstock?
- Getting the selected range of the navigator
- Get the x axis range on selecting a zoom range in Highcharts
- Is it possible to have two Y Axis in a highstock chart from highcharts one on the left and another on the right?
- Highstock charts - change position of rangeselector From and To inputs
- How to get the last 10 objects only from JSON data
- Highstock How to remove the cross icon in Range selector text box in IE
- When using Highcharts, how do you get the point name from a data point series?
- Highstock graph showing data outside selected range
- Can I add on the webpage, data that I get from a Highcharts function?
- How to get the period value from SMA technical indicators in highcharts?
More Query from same tag
- Is there a way to calculate custom label position on a Highcharts Activity Gauge?
- Why can't my code access this variable?
- How we can show Highchart column-placement chart for negative values?
- aligning datalabel to top of column highcharts
- how to add percentage sign along with int value in graph in java script
- show highcharts node text on top if the text is to long
- Selenium: How to relate an id or a class to a specific div?
- Selecting a point programmatically on stockchart from HighCharts library in GWT (Also in native JS)
- Highcharts Y axis horizontal title
- HighChart- Wrong Datetime in the X-Axis for Live Chart
- Highstock smooth panning
- Highcharts Map with React TypeScript
- Display multiple points with exact same value in scatter HighCharts
- Updating basic column high chart
- Adding a link to each stacked bar chart item
- Highcharts - How to change display data and remove mouseover?
- Lazy Loading for multiple series unlike multiple points in highcharts
- Navigator in highcharts graph does not work
- Is it possible use size (z) argument with RHighcharter and a categorical Y-axis?
- Highcharts : labels inside columnrange bar
- Navigator showing at 1970 when first point is null
- How to set "Y" position in label Highcharts
- HighCharts: Getting rid of tooltip but mantain crosshairs
- Annotation and its toolbar for Measure-x in High stocks is not appearing in the graph rather it is appearing in the navigator below
- Highchart legend
- HighCharts doesnt get data from Flask endpoint
- Highcharts: Column chart with empty data
- how to add values from my object to Highchart using Jquery
- Highcharts 5 data-labels width in CSS
- Calculating a min y axis value in highcharts