provide hovermode compare
未关闭
还没有人认领这个 Issue。
feature
P3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
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 .
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
比较 issue #2155 中引用的 plotly.js 行为与 plotly.py 接受的 layout hovermode 值,从当前拒绝 'compare' 的验证开始。确认 traces 之间所需的垂直 hover 行为,并验证受支持的值会产生所请求的显示。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, python
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100