Skip to content
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

Setting Y-Min for bar chart messes with interactions/tooltips #11733

Open
Travja opened this issue Apr 5, 2024 · 1 comment
Open

Setting Y-Min for bar chart messes with interactions/tooltips #11733

Travja opened this issue Apr 5, 2024 · 1 comment

Comments

@Travja
Copy link

Travja commented Apr 5, 2024

Expected behavior

When setting the interaction axis to 'x', intersect false, mode 'nearest' and then setting the y scale min value to 1, I would expect that hovering above the bars on the chart would show a tooltip on each of the bars.

Current behavior

Hovering over the individual bars does nothing. It's not until your cursor actually intersects the bars that the tooltip appears. If I change the y-min to 0.5, it appears to work normally. Setting it to 0.8 doesn't catch the shorter bars in the example, but does appear to work more like one would expect.

Reproducible sample

https://codepen.io/Travja/pen/eYoVjNg

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

4.4.2

Browser name and version

Chrome 123.0.6312.105

Link to your project

No response

@LeeLenaleee
Copy link
Collaborator

I gave it a quick look, seems like we take the middle point of an element and see if it is inside the chart area, which in this case is not.

Wil look more into this next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants