8000 hoverlabel alignment by Mahdis-z · Pull Request #175 · plotly/plotly.py-docs · GitHub
[go: up one dir, main page]

Skip to content

hoverlabel alignment #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
hoverlabel alignment
  • Loading branch information
“mahdis-z” committed Nov 6, 2019
commit 9dbcc3dd609cf9872f9ad34c38c09a19dadb469b
7 changes: 5 additions & 2 deletions python/hover-text-and-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ fig.show()

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.
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).
Hovertemplate customize the tooltip text vs. [texttemplate](https://plot.ly/python/reference/#pie-texttemplate) which customizes the text that appears on your chart.
Hovertemplate customize the tooltip text vs. [texttemplate](https://plot.ly/python/reference/#pie-texttemplate) which customizes the text that appears on your chart. <br>
Set the horizontal alignment of the text within tooltip with [hoverlabel.align](https://plot.ly/python/reference/#layout-hoverlabel-align).

```python
import plotly.graph_objects as go
Expand All @@ -128,7 +129,9 @@ fig.add_trace(go.Scatter(
hovertemplate = 'Price: %{y:$.2f}<extra></extra>',
showlegend = False))

fig.update_layout(title = "Set hover text with hovertemplate")
fig.update_layout(
hoverlabel_align = 'right',
title = "Set hover text with hovertemplate")

fig.show()
```
Expand Down
0