In my highchart, at some point, I need to update min, max and tickInterval yAxis. I tried 3 ways:
I tried the following code, but it says that "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, });
I also tried chart.redraw ... 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 errors, but the chart also does not update.
This time I tried updating the parameters and then creating 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 do not want to create a new highchart, I want to update the old one, because I use it in another method as well.
Please let me know how this can work, as well as if I create a new highchart using the third method, is there a way to get the last "chart" variable in another method?
thanks
source share