Skip to content

Commit ceeaf7b

Browse files
author
“mahdis-z”
committed
final revision
1 parent b9700e6 commit ceeaf7b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

python/hover-text-and-formatting.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ This template string can include `variables` in %{variable} format, `numbers` in
111111
Hovertemplate customize the tooltip text vs. [texttemplate](https://plot.ly/python/reference/#pie-texttemplate) which customizes the text that appears on your chart.
112112

113113
```python
114-
import plotly.graph_objs as go
115-
import plotly.io as pio
114+
import plotly.graph_objects as go
116115

117116
fig = go.Figure(go.Scatter(
118117
x = [1,2,3,4,5],
@@ -130,9 +129,7 @@ fig.add_trace(go.Scatter(
130129
hovertemplate = 'Price: %{y:$.2f}<extra></extra>',
131130
showlegend = False))
132131

133-
fig.update_layout(
134-
title = "Set hover text with hovertemplate",
135-
template = pio.templates['plotly'])
132+
fig.update_layout(title = "Set hover text with hovertemplate")
136133

137134
fig.show()
138135
```
@@ -152,7 +149,7 @@ fig.show()
152149
```
153150

154151
### Advanced Hover Template
155-
The following example shows how to format hover template. [Here](https://plot.ly/python/v3/hover-text-and-formatting/#dash-example) is an example to see how to format hovetemplate in Dash.
152+
The following example shows how to format hover template. [Here](https://plot.ly/python/v3/hover-text-and-formatting/#dash-example) is an example to see how to format hovertemplate in Dash.
156153

157154
```python
158155
import plotly.graph_objects as go

0 commit comments

Comments
 (0)