The problem is setExtremes(min, max) method returns undefined, so you can not chain options. Solution is to wrap this method and pass on context, for example:

(function(H) {
  H.wrap(H.Axis.prototype, 'setExtremes', function (proceed) {
    proceed.apply(this,, 1);
    return this; // <-- context for chaining

Now we can use:

return window.Highcharts.charts[0].xAxis[0].setExtremes(min, max).series[0];

Note: The snippet can be placed in a separate file and used like any other Highcharts plugin (simply load after Highcharts library).


Axis object has references only to series that are bound to this axis. If you want to access any series on the chart use:

return window.Highcharts.charts[0].xAxis[0].setExtremes(min, max).chart.series[0];


I am trying to execute your code on Highcharts demo page
The problem is with xAxis[0], xAxis is not an array but a dictionary, so you must supply a string value there inside those [].

check xAxis in the docs
I am guessing you're looking for


I see now that xAxis can be an array, but you're most likely missing those events so my solution should be changed to xAxis[0].events.setExtremes

Related Query

More Query from same tag