Hover over filled area: incorrect text
See original GitHub issueI’m trying to build a stacked area chart, starting from the example provided here.
However, the hover text does not always match the hovered area. In the following screen shot, I’m actually over the blue area, close to y = 0
.
I’m using the following code to plot online (the aim is to use this in a Dash application).
import plotly.graph_objects as go
fig = go.Figure()
for i, y in enumerate([0, 1]):
values=[i, 1 + i, 2 + i, 1 + i, i]
fig.add_trace(go.Scatter(x=[0, 1, 2, 3, 4], y=values,
stackgroup="one",
hoveron = 'points+fills', # select where hover is active
name=f"Trace {y}",
text=[f"<span>Value: {v}</span>" for v in values],
hoverinfo = 'text+x'))
fig.update_layout(
title = "hover on <i>points</i> or <i>fill</i>",
)
Also, with the same setting, the label is wrong : withhoverinfo='text+x'
, the text in the hover is the name of the trace. Note that the hovers on the markers are correct.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Hover Text over Fill area - Plotly Python
I have a plot of digital signals. I am trying to shade in certain 'stages' of the process that I am recording.
Read more >Hover Text over fill area Python plotly - Stack Overflow
I have a plot of digital signals. I am trying to shade in certain 'stages' of the process that I am recording. I...
Read more >hover - CSS: Cascading Style Sheets - MDN Web Docs
It is generally triggered when the user hovers over an element with the cursor (mouse pointer).
Read more >How To Create Help Text and Pop-Up Hover Tip ... - YouTube
HOW TO CREATE HELP TEXT AND POP-UP HOVER TIP TEXT IN A FILLABLE FORM IN MS WORD // Learn three ways to insert...
Read more >Report page tooltips/pop up on hover charts in Power BI in 2 ...
... that lets you create a dashboard/report page when you hover over a data point, this could contain charts, cards tables text boxes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I see. I was referring to the contents of the hover-label, and confirming that indeed when hovering on fills, you only get to see the trace name and this is by design today.
If you’re seeing issues where the wrong hover-label is showing up, this is probably something that we need to bring up in the Plotly.js repo. I’ll try to pull together a minimal JS-only CodePen.
a workaround could be to use
fig.update_layout(hovermode='x unified')