highcharts - How to setExtremes in xAxis event handler? -
i trying setextremes in xaxis event handler below , getting uncaught typeerror. how can setextremes in xaxis event handler?
xaxis: { events: { setextremes: function (e) { if (e.trigger === "navigator") { forcerebuildseries(); //get data points // set extremes (redisplay new data points) this.chart.xaxis[0].setextremes(e.min, e.max); //uncaught typeerror: property 'setextremes' of object #<object> not function } } } },
i appreciate or workaround available. thanks.
i know bit late, wanted add answer future visitors.
highchart doesn't allow call setextremes inside setextremes eventhandler in order avoid endless loop. that's why error.
you can, however, insert timeout in order work around protection:
xaxis: { events: { setextremes: function (e) { if (e.trigger === "navigator") { var c = this; settimeout(function() { forcerebuildseries(); //get data points // set extremes (redisplay new data points) c.chart.xaxis[0].setextremes(e.min, e.max); }, 1); } } } }
Comments
Post a Comment