knightjdr
Posts: 2
Joined: Thu Dec 01, 2022 12:19 am

Manually updating a sunburst series in a click event disables breadcrumbs

I have a sunburst chart where I want to control the maximum number of levels shown. I'm handling this in the series -> point -> events -> click function and it is working well. In the function I simply adjust the value of levelSize between 0 and 1 and then call

Code: Select all

this.series.chart.series[0].update({ levels })
with the updated levels.

However, when I do this the breadcrumbs no longer show. I'm guessing it's because I'm overriding the normal update that would occur, and which would handle changes to the breadcrumb state. I suppose I need to update the series breadcrumbs at the same time as I update the levels, but I'm not sure on how to do that. Any examples or help would be greatly appreciated.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Manually updating a sunburst series in a click event disables breadcrumbs

Hello there,

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

Would you be able to show us your reproduced problem with the breadcrumbs? The best way of doing that would be to recreate the demo in JSFiddle.

Let me know once you do that,
Regards!
Kamil Musiałowski
Highcharts Developer
knightjdr
Posts: 2
Joined: Thu Dec 01, 2022 12:19 am

Re: Manually updating a sunburst series in a click event disables breadcrumbs

Here is a CodePen example: https://codepen.io/knightjdr/pen/bGKmpmg

This example shows the breadcrumbs not being displayed on click with my custom click logic. If you comment line 73, you'll see the default behavior for the breadcrumbs.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Manually updating a sunburst series in a click event disables breadcrumbs

It looks like quite a custom functionality, which may cause some unwanted side effects. In that case, you can try to render the Breadcrumbs manually. Here is the article about it: https://www.highcharts.com/docs/advance ... standalone
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”