Cortez
Posts: 85
Joined: Fri May 29, 2020 9:41 am

Calling legend.update() makes unstacked chart to stack

Hi guys!
DEMO: https://jsfiddle.net/Cortez/51xup06d/

I am using Highcharts 8.2.0 in my app, and can not upgrade anytime soon.
Click on "Update Legend" button and you will see how all columns merge into stacks :)
This must be related somehow to 'centerInCategory' option, because when set to 'false', the problem does not reproduce.

However, this issue is fixed in later versions (on current version it doesn't reproduce).
So, the question is - can you please share some kind of polyfill wrapper or something, for I could compliment my outdated library version with a fix for this issue, without having to do an upgrade right now.
Thanks!
Cortez
Posts: 85
Joined: Fri May 29, 2020 9:41 am

Re: Calling legend.update() makes unstacked chart to stack

A small remark: I am on version 8.1.2, not 8.2.0
Cortez
Posts: 85
Joined: Fri May 29, 2020 9:41 am

Re: Calling legend.update() makes unstacked chart to stack

Well, I believe I'll have to upgrade. I've found one more 'centerInCategory' inconsistent behavior in version 8.1.2.
https://jsfiddle.net/Cortez/5tvd3Lma/
After clicking on 'Add Point' button see how newly added column is overlapped by neighbouring column. This does not happens when 'centerInCategory' is false. And this does not happen on latest version of the lib.

So I am not sure if you guys should provide me with so many polyfills :)
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Calling legend.update() makes unstacked chart to stack

Hi Cortez!
Thanks for contacting us with your question!

You can just override chart.redraw() function with the one from the newest release, but I have to admit, that it's not a good approach. I suggest you upgrade your as soon as possible your Highcharts to the newest version. Also, as you have found on your own, more things are also improved in the latest releases.

Here you can find a plugin with overriding redraw function: https://jsfiddle.net/BlackLabel/wuhovjtx/

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”