Skip to content

Commit e57adbd

Browse files
committed
Fix broken example
1 parent b8c2bf4 commit e57adbd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

doc/python/hover-text-and-formatting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ fig.show()
8787

8888
*New in 6.8*
8989

90-
In `'x unified'` and `'y unified'` hover modes, items in the hover label appear in the order their traces were added to the figure. Set `layout.hoversort` to `"descending"` or `"ascending"` to instead sort the items by the value being shown, which makes it easier to compare traces at a glance.
90+
In `'x unified'` and `'y unified'` hover modes, items in the hover label appear in the order their traces were added to the figure (the default, `hoversort="trace"`). Set `layout.hoversort` to `"value descending"` or `"value ascending"` to instead sort the items by the value being shown, which makes it easier to compare traces at a glance.
9191

9292
```python
9393
import plotly.express as px
9494

9595
df = px.data.stocks()
9696

97-
fig = px.line(df, x="date", y=df.columns[1:], title="layout.hoversort='descending'")
97+
fig = px.line(df, x="date", y=df.columns[1:], title="layout.hoversort='value descending'")
9898
fig.update_traces(hovertemplate=None)
99-
fig.update_layout(hovermode="x unified", hoversort="descending")
99+
fig.update_layout(hovermode="x unified", hoversort="value descending")
100100

101101
fig.show()
102102
```

0 commit comments

Comments
 (0)