provide hovermode compare
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
I want hover a position show all data accross vertical line, like :

I found javascript version have this https://github.com/plotly/plotly.js/issues/2155#issuecomment-351393616
But hovermode='compare' got error
ValueError:
Invalid value of type 'builtins.str' received for the 'hovermode' property of layout
Received value: 'compare'
The 'hovermode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['x', 'y', 'closest', False]
PS: I really think bokeh's hovertool is much better than plotly , at least they put all hover relative things in one place with examples , easy to found what you want, simply add mode='vline' would work
HoverTool(
tooltips=[
( 'date', '@date{%F}' ),
( 'close', '$@{adj close}{%0.2f}' ), # use @{ } for field names with spaces
( 'volume', '@volume{0.00 a}' ),
],
formatters={
'date' : 'datetime', # use 'datetime' formatter for 'date' field
'adj close' : 'printf', # use 'printf' formatter for 'adj close' field
# use default 'numeral' formatter for other fields
},
# display a tooltip whenever the cursor is vertically in line with a glyph
mode='vline
')
plotly document contain many things but didn't group well, find a solution is not easy .
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the plotly.js behavior referenced in issue #2155 with plotly.py's accepted layout hovermode values, starting at the validation that currently rejects 'compare'. Confirm the desired vertical hover behavior across traces and verify that the supported value produces the requested display.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100