I have an Highcharts Stock graph with 4 different grouping buttons: by Day, by Week, by Month and by Year.
I have also a dropdown list outside of Highcharts that allows to determine different periods on the graph with SetExtremes.
When the user is selecting one of the options, the graph should always be on Day grouping. How can I achieve that?
My code for the dropdown looks like this so far:
Code: Select all
select1_2.change(function() {
// How to start by forcing day grouping?
chart1_2.xAxis[0].setExtremes();
switch(select1_2.val()) {
case 'option1':
chart1_2.xAxis[0].setExtremes(period1[0], period1[1]);
break;
case 'option2':
chart1_2.xAxis[0].setExtremes(period2[0], period2[1]);
break;
case 'option3':
chart1_2.xAxis[0].setExtremes(period3[0], period3[1]);
break;
case 'option4':
chart1_2.xAxis[0].setExtremes(period4[0], chart1_2.xAxis[0].getExtremes().max);
break;
case 'option99':
chart1_2.xAxis[0].setExtremes(chart1_2.xAxis[0].getExtremes().min, chart1_2.xAxis[0].getExtremes().max);
break;
default:
//...
}
chart1_2.reflow();
});
I have tried with this, but it's not working as expected:
Code: Select all
chart1_2.rangeSelector.options.selected = 0;
Any idea how to do this?
Thanks for your help!