In my highchart, at some point, I need to update min, max and tickInterval of a yAxis. I tried 3 ways:
I tried the following code, but it says "object# has no menthod 'update'"
var extremes = chart.yAxis[i].getExtremes(); chart.yAxis[i].update({ min: extremes.dataMin * 1.1, max: extremes.dataMax * 1.1, tickInterval : SomeValue, });Also I tried chart.redraw as well... using the following code
chart.yAxis[i].min = extremes.dataMin * 1.1; chart.yAxis[i].max = extremes.dataMax * 1.1; chart.yAxis[i].tickInterval = SomeValue; chart.redraw();This time it does not show any error, but the chart does not refreshed as well.
This time,I tried to update the options and then to create a new highchart:
options.yAxis[i].min = extremes.dataMin * 1.1; options.yAxis[i].max = extremes.dataMax * 1.1; options.yAxis[i].tickInterval = SomeValue; chart = new Highcharts.Chart(options);
It works this time, but I dont want to create a new highchart, I want to update the old one, because I am using it in one another method too.
Please let me know, how this can work, and also if I create new highchart using the 3rd way, then is there a way to get the latest 'chart' variable in another method?
Thank you