I am trying to setExtremes in the xAxis event handler below and I am getting the Uncaught TypeError. How can I setExtremes in the xAxis event handler?
xAxis: {
events: {
setExtremes: function (e) {
if (e.trigger === "navigator") {
forceRebuildSeries(); //Get all data points
// Set Extremes (redisplay with new data points)
this.chart.xAxis[0].setExtremes(e.min, e.max); //Uncaught TypeError: Property 'setExtremes' of object #<Object> is not a function
}
}
}
},
I would appreciate any help or workaround available. Thanks.
I know this is it bit late, just wanted to add my answer to future visitors.
Highchart doesn't allow to call setExtremes from inside the setExtremes eventhandler in order to avoid an endless loop. That's why you get the error.
You can, however, insert a timeout in order to work around this protection:
xAxis: {
events: {
setExtremes: function (e) {
if (e.trigger === "navigator") {
var c = this;
setTimeout(function() {
forceRebuildSeries(); //Get all data points
// Set Extremes (redisplay with new data points)
c.chart.xAxis[0].setExtremes(e.min, e.max);
}, 1);
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With