chuang
Posts: 13
Joined: Tue Feb 20, 2024 1:58 am

Treemap colorAxis not working

I'm trying to add a colorAxis to my treemap in the dashboard and it doesn't seem to be coloring the chart correctly.

See: https://jsfiddle.net/chuang_acumen/acs0x719/35/
User avatar
dawid.d
Site Moderator
Posts: 1184
Joined: Thu Oct 06, 2022 11:31 am

Re: Treemap colorAxis not working

Hello,

Thanks for the question!

The first thing is that since version v3.0.0 we have disabled the default Styled Mode for Highcharts Components, so make sure that (alternatively):
- highcharts.css is not imported, OR
- styled mode is manually enabled and highcharts.css is imported

The problem you are experiencing here is a bug in Highcharts Core related to incorrect updating of series data array when `keys` are set along with it.

Workaround is simple, but requires copying a bit of code and making a small change there in the form of adding update keys before updating the rest of the options in the series. See the demo with the workaround plugin below.

Demo: https://jsfiddle.net/BlackLabel/yskg1vL4/

The bug is reported here: https://github.com/highcharts/highcharts/issues/20687

Best regards!
Dawid Draguła
Highcharts Developer
User avatar
dawid.d
Site Moderator
Posts: 1184
Joined: Thu Oct 06, 2022 11:31 am

Re: Treemap colorAxis not working

I've implemented the workaround in Dashboards until the core team fixes it, here: https://github.com/highcharts/highcharts/pull/22104
After the next release, it won't be necessary to workaround it like this on your side.
Dawid Draguła
Highcharts Developer

Return to “Highcharts Dashboards”