Zoomable Sunburst labelling question

Regarding the Zoomable Sunburst and Zoomable Icicle charts…

When you drill down into these charts, the parent category label can disappear, leaving you looking only at the children labels. Is there any way, upon clicking, to put the parent label in a variable and display it somewhere on the chart (the donut hole in the Sunburst, or the left-hand column on the Icicle)?

A related question: I’m using HTML divs to display the chart on one side of a web page, and explanatory text beside it. Can I get any level-information from the current status of my drill-down into the chart, and display it in my other div?

Thanks.

Hi,
Here’s an example of displaying the parent.

I think you should be able to display the path status in another div. In the onclick function, use the p variable after

parent.datum(p.parent || root);

to an element in your other div, or you could set the value property in your sunburst chart.

1 Like

Thanks! I got it working in the center circle of the Zoomable Sunburst. Much improved.

https://observablehq.com/d/58fccc0c73c3e203

Haven’t yet tried to get the path status into another div. I may be back to you. :slight_smile: