Daniel Ocanto
Posts: 19
Joined: Wed Nov 30, 2022 2:40 pm

Disable redraw after use chart.axes[0].setExtremes(min,max)

I am making a graph that constantly changes several parameters within the map, I am aware of the parameter of chart.update(data, redraw) I want to know if there is something similar for setExtremes and if not, what alternative do I have. Thanks.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Disable redraw after use chart.axes[0].setExtremes(min,max)

Hello Daniel,

Welcome to our forum and thank you for contacting us with your question!

Your post message is kinda misleading, but following what you have said in the title, to disable the redraw after calling the setExtremes method, the best idea would be to simply pass false as its third argument to prevent from calling the redraw method.
More about that here: https://api.highcharts.com/class-refere ... etExtremes

In case of any other questions, do not hesitate to contact us anytime,
Regards!
Kamil Musiałowski
Highcharts Developer
Daniel Ocanto
Posts: 19
Joined: Wed Nov 30, 2022 2:40 pm

Re: Disable redraw after use chart.axes[0].setExtremes(min,max)

kamil.m wrote: Wed Nov 30, 2022 3:09 pm Your post message is kinda misleading, but following what you have said in the title, to disable the redraw after calling the setExtremes method, the best idea would be to simply pass false as its third argument to prevent from calling the redraw method.
More about that here: https://api.highcharts.com/class-refere ... etExtremes

In case of any other questions, do not hesitate to contact us anytime,
Regards!
Thank you very much for your answer, the link you gave me is very helpful. And I'm sorry for the explanation, I think I didn't know how to explain myself properly.
I have a question... When I set the extremes, I try to place decimal numbers on the y-axis but the extreme is rounded, specifically I put the minimum at -2.5 and the maximum at 2.5 and when I execute the function it rounds to -3 and 3 respectively... I'm not sure how to upload an example of my code as I've seen the rest, if you could explain it I'd be grateful.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Disable redraw after use chart.axes[0].setExtremes(min,max)

You're welcome! Don't worry about the explanation, at least we got the solution right :)

For rounding up, please take a look at these two links. In the first one, you will find a description on what could affect the rounding, where the second one is a deeper explanation of how it works in general.

https://api.highcharts.com/highcharts/yAxis.min
https://stackoverflow.com/questions/724 ... c-rounding

Best regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”