BananCoins
Posts: 20
Joined: Fri Apr 01, 2022 9:23 am

How to reflow the tick positioner

Hi there, I tried to refresh the highcharts with the new positions showing different positions (from [0,50,80] to [2,51,98])

Live Demo : https://jsfiddle.net/ge6p0xb5/
BananCoins
Posts: 20
Joined: Fri Apr 01, 2022 9:23 am

Re: How to reflow the tick positioner

I have added console log on tickPositioner. The variable has been update but the diagram didn't update.

https://jsfiddle.net/jwqy43mo/
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: How to reflow the tick positioner

Hello BananCoins!
Thanks for contacting us with your question!

You based your chart configuration on variables made with var constructor, which are hoisted. That's why you could use that variable in the chart configuration above variables declaration. It is not a good habit to do this in this way. I suggest you use a axis update method with new array of ticks passed to tickPositions/tickPositioner property. The update method has a built-in redraw logic, which will draw a chart after its call. You can check it in the demo below.

Demo: https://jsfiddle.net/BlackLabel/1etbuv75/
API Reference: https://api.highcharts.com/class-refere ... xis#update

Let me know if you have any further questions.
Best regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”