Plotly Sunburst chart

Hi Community ,

I have been trying to add values in the default example for Sunburst Chart.
But the branchvalues =‘total’ is not showing any graph. if i remove that line then the graph displayed is not equally distributed.
Any Help!!!
Code:
import plotly.plotly as py
import plotly.graph_objs as go
trace = go.Sunburst(
ids=[
“North America”, “Europe”, “Australia”, “North America - Football”, “Soccer”,
“North America - Rugby”, “Europe - Football”, “Rugby”,
“Europe - American Football”,“Australia - Football”, “Association”,
“Australian Rules”, “Australia - American Football”, “Australia - Rugby”,
“Rugby League”, “Rugby Union”
],
labels= [
“North
America”, “Europe”, “Australia”, “Football”, “Soccer”, “Rugby”,
“Football”, “Rugby”, “American
Football”, “Football”, “Association”,
“Australian
Rules”, “American
Football”, “Rugby”, “Rugby
League”,
“Rugby
Union”
],
parents=[
“”, “”, “”, “North America”, “North America”, “North America”, “Europe”,
“Europe”, “Europe”,“Australia”, “Australia - Football”, “Australia - Football”,
“Australia - Football”, “Australia - Football”, “Australia - Rugby”,
“Australia - Rugby”
],
values = [100,100,100,33,34,33,40,20,40,100,20,20,20,40,20,20],
#branchvalues=‘total’,
outsidetextfont={“size”: 20, “color”: “#377eb8”},
leaf={“opacity”: 0.4},
marker={“line”: {“width”: 2}}
)

layout = go.Layout(
margin = go.layout.Margin(t=0, l=0, r=0, b=0),
sunburstcolorway=["#636efa","#ef553b","#00cc96"]
)

fig = go.Figure([trace], layout)
iplot(fig)

image

2 Likes

I’m having this same issue, all of the value add up to their parents and so on! were you able to solve this? I would greatly appreciate any help

The only thing I can think of is that my values are floats and that’s making an issue

1 Like

no Dmrks i used multipe pie chart ! but collapsing and expanding feature will not be present in pie charts

1 Like