-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Reproducible example
See the demo: https://codepen.io/Lexachoc/pen/MYaJGgo
The problem
When using hovermode:'x'
, the hoverinfo is displaying when hovering through all bins (including those count=0).
Note that the binNumber (extracted from the hover event) has remained at the first empty bin number!
Why this is important to address
- It breaks the expected behavior of
hovermode:'x'
over consecutive zero-count bins.
I expected hover events to fire across the entire x-axis regardless of the bin value (y value). plotly_hover
reports stale binNumber value, unable to know the actual bin under the cursor when y=0 (count=0).
Note
I use hovermode:'x'
because I want hover events to trigger even when the cursor is above the bin, not just directly over the bar area. The default hover behavior only fires when hovering on the bar itself.
Use case
You can see the hover highlight becomes disconnected because no hover event is fired over consecutive zero-count bins, causing the effect to break.