plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.18k stars 1.03k forks source link

Legend for Sunburst Charts (at minimum for colorBy, for accessibility) #2402

Open pstaubs opened 1 year ago

pstaubs commented 1 year ago

Is your feature request related to a problem? Please describe. I want to include a legend in a sunburst chart (for example to make the chart still readable if it is printed, or just better accessibility: tooltips have a lot of problems when there are no alternatives for accessing information). This doesn't seem possible at this time? Legends are not mentioned in https://nivo.rocks/sunburst/ nor do i see any examples in https://nivo.rocks/storybook/?path=/docs/sunburst--docs. I've tried adding a legend attribute to my ResponsiveSunburst and I see nothing.

Describe the solution you'd like Sunburst should simply accept the legends attribute. Placing each arc and child arc on the legend will likely be excessive in most cases. But, the sunburst chart already supports colorBy categorization. The legend need merely identify what each color represents. This would improve accessibility of the colorBy categorization significantly. The arcLabels attribute already solves the problem of making data accessible in child arcs.

Describe alternatives you've considered https://github.com/plouc/nivo/issues/1160 has basically already asked for this issue and it did not receive a response and is now stale. That issue does mention a workaround which I will try in the meantime. However, this is less than ideal, and highlights a general lack of consistency when similar charts Pie and RadialBar support it.

Additional context N/A

stale[bot] commented 10 months ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!