Skip to content

Commit 4115244

Browse files
authored
Update sunburst_chart.py
1 parent 223154b commit 4115244

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import plotly graph_objects as go
2+
3+
labels = ["Root", "Branch 1",
4+
"Branch 2", "Leaf 1", "Leaf 2",
5+
"Leaf 3"
6+
7+
parents = ["'', "Root",
8+
"Root", "Branchir1g, "Branch 1", "Branch 2"]
9+
10+
values = [10, 5, 5, 2, 3, 5]
11+
12+
fig = go. Figure(go. Sunburst(
13+
labels=labels,
14+
parents=parents,
15+
values=values,
16+
branchvalues="total", ))
17+
18+
fig. update_layout(
19+
title="Sunburst Chart in Python",
20+
margin=dict (t=30, 1=0, r=0, b=0))
21+
22+
fig. show()

0 commit comments

Comments
 (0)