John Fred John Fred - 6 months ago 41
jQuery Question

Highstock Trigger javascript when range selector button clicked

How would I get, say, an

alert("Don't touch me!")
to execute when I press the '2Week' button in the following fiddle:


You can catch the setExtremes event, check e.rangeSelectorButton.text and find a current button. Then call custom action.

   xAxis: {
     events: {
       setExtremes: function(e) {
        if (e.rangeSelectorButton.text === "2Weeks") {