Luca
Posts: 11
Joined: Tue Nov 08, 2022 12:56 pm

Sunburst chart: Drillup changes order of nodes

Hello, Forum,

I have a sunburst chart and I need the rings to stay in the same order when drilled up.

Consider this example: https://jsfiddle.net/pva3968o/

If you drill down to B and then back up, B will become the first child of root.

If you set a break point after let data in line 83, you will see that data is the same as the initial data, but in the rendered chart, B will be the first child instead of A.

How can I keep the order A, B, C when I drill down to B or C and then back up?

This is a follow-up question to viewtopic.php?f=9&t=49811, that's why I use replacement with setData instead of allowTraversingTree.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Sunburst chart: Drillup changes order of nodes

Hello,

This is because during drillup you set data in which there are already points to which you did drilldown, so the library optimizes the update taking into account the existing ones and adds only those that are missing, which makes those ones go to the first place.

You can disable this optimization with the 4th parameter of the setData(data [, redraw] [, animation] [, updatePoints]) method.

Demo: https://jsfiddle.net/BlackLabel/uhs8ng6t/
API: https://api.highcharts.com/class-refere ... es#setData

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
Luca
Posts: 11
Joined: Tue Nov 08, 2022 12:56 pm

Re: Sunburst chart: Drillup changes order of nodes

Thank you, it works.

Is there a way to get the animation on drillup back?

Thank you for your patience.

Best regards,
Luca
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Sunburst chart: Drillup changes order of nodes

Hi,

In your case where you are using your own custom logic for drilldown (setting data) this is not possible. If you want animation functionality you should use the default drilldown.

Regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
Luca
Posts: 11
Joined: Tue Nov 08, 2022 12:56 pm

Re: Sunburst chart: Drillup changes order of nodes

Thank you. Your information was helpful.

Best regards,
Luca
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Sunburst chart: Drillup changes order of nodes

You're welcome!

Regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Usage”