Skip to content

Stacked Pie/Donut Chart #1154

Answered by hshoff
jakiestfu asked this question in Q&A
Apr 9, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @jakiestfu,

You're looking for a sunburst chart. To do this you need to:

  1. create a root using hierarchy() from either d3-hierarchy or @visx/hierarchy re-export alias
  2. use <Partition root={root}>{(partition) => // stuff}</Partition> passing your root as a prop
  3. in the <Partition> function as children, map over partition.descendants() nodes returning an <Arc /> for each node

more details/an example here: #1085

Hope this helps!

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@jakiestfu
Comment options

@jakiestfu
Comment options

Answer selected by jakiestfu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1153 on April 09, 2021 16:18.