highstock - which rangeSelector button is selected in highcharts -


i want know how determine rangeselector button selected in highstock.

my rangeselector buttons:

   buttons: [{             type: 'month',             count: 1,             text: '1 month',         }, {             type: 'month',             count: 3,             text: '3 month'         }, {             type: 'month',             count: 6,             text: '6 month'         }, {             type: 'ytd',             text: 'ytd'         }, {             type: 'year',             count: 1,             text: '1 year'         }, {             type: 'all',             text: 'all'         }], 

for example click on first rangeselector 1 month. want know if button selected or not.

is there event?

thanks

you can catch setextremes() (http://api.highcharts.com/highstock#xaxis.events.setextremes), , in event obejct have access event.rangeselectorbutton object count, text , type property.

 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);                 }             }         }     }, 

http://jsfiddle.net/e6ghc/1/


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -