You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/hover-text-and-formatting.md
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -111,8 +111,7 @@ This template string can include `variables` in %{variable} format, `numbers` in
111
111
Hovertemplate customize the tooltip text vs.[texttemplate](https://plot.ly/python/reference/#pie-texttemplate) which customizes the text that appears on your chart.
112
112
113
113
```python
114
-
import plotly.graph_objsas go
115
-
import plotly.ioas pio
114
+
import plotly.graph_objectsas go
116
115
117
116
fig= go.Figure(go.Scatter(
118
117
x= [1,2,3,4,5],
@@ -130,9 +129,7 @@ fig.add_trace(go.Scatter(
130
129
hovertemplate='Price: %{y:$.2f}<extra></extra>',
131
130
showlegend=False))
132
131
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")
136
133
137
134
fig.show()
138
135
```
@@ -152,7 +149,7 @@ fig.show()
152
149
```
153
150
154
151
###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 formathovetemplate 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 formathovertemplate in Dash.