withr withr - 2 years ago 236
Javascript Question

Highcharts chart.events.redraw doesn't work for chart.xAxis[0].update

I need to change the xaxis step when the chart was redrawed, e.g. when it was zoomed in. I tried the javascript function for like this:

chart: {
zoomType: 'xy',
events: {
redraw: function(){
var chart = $("#container").highcharts();
lables: {
step: 2

But, it doesn't work. Is that a buy? Any help will be appreciated!

Answer Source

It's not possible because will create infinite loop - update options and redraw them in redraw callback. Instead I advice to use afterSetExtremes and call update without redraw: .update( options, false)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download