Skip to content

Commit a97b2b4

Browse files
committed
Update icicle-charts.md
1 parent 7570bbf commit a97b2b4

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

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

+28-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 Icicle Charts.
2626
display_as: basic
@@ -418,6 +418,30 @@ fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))
418418
fig.show()
419419
```
420420

421+
### Pattern Fills
422+
423+
*New in 5.15*
424+
425+
Icicle charts support [patterns](/python/pattern-hatching-texture/) (also known as hatching or texture) in addition to color. In this example, we apply a pattern to all chart sections. We also configure the size and solidity of the pattern.
426+
427+
```python
428+
import plotly.graph_objects as go
429+
430+
fig = go.Figure(
431+
go.Icicle(
432+
labels=["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
433+
parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"],
434+
values=[10, 14, 12, 10, 2, 6, 6, 4, 4],
435+
root_color="lightgrey",
436+
textfont_size=20,
437+
marker=dict(pattern=dict(shape="|", size=5, solidity=0.9)),
438+
)
439+
)
440+
441+
fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))
442+
fig.show()
443+
```
444+
421445
### Set the Direction of Icicle charts
422446

423447
As mentioned above, Icicle charts can grow in one of four directions. Icicle charts have a `tiling` attribute and this has two attributes: `orientation` and `flip`. `orientation` takes either `h` (horiztonal) or `v` (vertical) and `flip` takes either `x` or `y`. You can use these two attributes in combination to create each of the four cardinal directions: left, right, top, bottom.

0 commit comments

Comments
 (0)