Skip to content

Commit 8a9021a

Browse files
authored
Update sunburst_chart.py
1 parent e258e5c commit 8a9021a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
import plotly graph_objects as go
1+
import plotly.graph_objects as go
22

3-
labels = ["Root", "Branch 1",
4-
"Branch 2", "Leaf 1", "Leaf 2",
5-
"Leaf 3"
3+
labels = ["Root", "Branch 1","Branch 2", "Leaf 1", "Leaf 2", "Leaf 3"]
64

7-
parents = ["'', "Root",
8-
"Root", "Branchir1g, "Branch 1", "Branch 2"]
5+
parents = ['', "Root","Root", "Branch 1", "Branch 1", "Branch 2"]
96

107
values = [10, 5, 5, 2, 3, 5]
118

12-
fig = go. Figure(go. Sunburst(
13-
labels=labels,
9+
fig = go.Figure(go.Sunburst(labels=labels,
1410
parents=parents,
1511
values=values,
16-
branchvalues="total", ))
12+
branchvalues="total" ))
1713

1814
fig. update_layout(
1915
title="Sunburst Chart in Python",
20-
margin=dict (t=30, 1=0, r=0, b=0))
16+
margin=dict (t=30, l=0, r=0, b=0))
2117

22-
fig. show()
18+
fig. show()

0 commit comments

Comments
 (0)