Skip to content

hovertemplate.py #154

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 8 commits into from
Nov 2, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
final revision
  • Loading branch information
“mahdis-z” committed Nov 1, 2019
commit ceeaf7ba5814787c79d92bf3104c31efbccc6855
9 changes: 3 additions & 6 deletions python/hover-text-and-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ This template string can include `variables` in %{variable} format, `numbers` in
Hovertemplate customize the tooltip text vs. [texttemplate](https://plot.ly/python/reference/#pie-texttemplate) which customizes the text that appears on your chart.

```python
import plotly.graph_objs as go
import plotly.io as pio
import plotly.graph_objects as go

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

fig.update_layout(
title = "Set hover text with hovertemplate",
template = pio.templates['plotly'])
fig.update_layout(title = "Set hover text with hovertemplate")

fig.show()
```
Expand All @@ -152,7 +149,7 @@ fig.show()
```

### Advanced Hover Template
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.
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.

```python
import plotly.graph_objects as go
Expand Down