Skip to content

Commit 253fa4e

Browse files
committed
Update sunburst-charts.md
1 parent c24c060 commit 253fa4e

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

Diff for: doc/python/sunburst-charts.md

+32-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
9-
jupytext_version: 1.4.2
8+
format_version: '1.3'
9+
jupytext_version: 1.14.6
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.7
23+
version: 3.10.11
2424
plotly:
2525
description: How to make Sunburst Charts.
2626
display_as: basic
@@ -300,6 +300,34 @@ fig.update_layout(uniformtext=dict(minsize=10, mode='hide'))
300300
fig.show()
301301
```
302302

303+
### Pattern Fills
304+
305+
*New in 5.15*
306+
307+
Sunburst charts support [patterns](/python/pattern-hatching-texture/) (also known as hatching or texture) in addition to color. In this example, we add a different pattern to each level of the hierarchy. We also specify the `solidity` of the pattern.
308+
309+
```python
310+
import plotly.graph_objects as go
311+
312+
fig = go.Figure(
313+
go.Sunburst(
314+
labels=["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
315+
parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"],
316+
values=[65, 14, 12, 10, 2, 6, 6, 4, 4],
317+
branchvalues="total",
318+
textfont_size=16,
319+
marker={
320+
"pattern": {"shape": ["", "/", "/", ".", ".", "/", "/", ".", "/"], "solidity": 0.9}
321+
},
322+
)
323+
)
324+
325+
fig.update_layout(margin=dict(t=0, l=0, r=0, b=0))
326+
327+
fig.show()
328+
329+
```
330+
303331
### Sunburst chart with a continuous colorscale
304332

305333
The example below visualizes a breakdown of sales (corresponding to sector width) and call success rate (corresponding to sector color) by region, county and salesperson level. For example, when exploring the data you can see that although the East region is behaving poorly, the Tyler county is still above average -- however, its performance is reduced by the poor success rate of salesperson GT.

0 commit comments

Comments
 (0)