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
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,8 @@ fig.show()
107
107
108
108
To customize the tooltip on your graph you can use[hovertemplate](https://plot.ly/python/reference/#pie-hovertemplate), which is a template string used for rendering the information that appear on hoverbox.
109
109
This template string can include`variables` in %{variable} format,`numbers` in[d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_forma), and`date` in[d3-time-fomrat's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format).
110
-
Hovertemplate customize the tooltip text vs.[texttemplate](https://plot.ly/python/reference/#pie-texttemplate) which customizes the text that appears on your chart.
110
+
Hovertemplate customize the tooltip text vs.[texttemplate](https://plot.ly/python/reference/#pie-texttemplate) which customizes the text that appears on your chart. <br>
111
+
Set the horizontal alignment of the text within tooltip with[hoverlabel.align](https://plot.ly/python/reference/#layout-hoverlabel-align).
111
112
112
113
```python
113
114
import plotly.graph_objectsas go
@@ -128,7 +129,9 @@ fig.add_trace(go.Scatter(
128
129
hovertemplate='Price: %{y:$.2f}<extra></extra>',
129
130
showlegend=False))
130
131
131
-
fig.update_layout(title="Set hover text with hovertemplate")