How to add the legend in a diagram Sunburst?

I have one new requirement for sunburst diagram ’ Zoomable Sunburst / D3 / Observable .’
How to add some code to add legends next to the sunburst for top 4 categories?
image

You can try using Swatches from Color Legend / D3 / Observable.

1 Like

Thanks saneef. I got the other good example from Zoomable Sunburst with legend / 3sam3 / Observable.

1 Like