-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Intersect False and PointHoverRadius #3615
Comments
@frlinw do you mean the hover styling that makes the radius change? |
If I understood correctly, you're asking if the |
Yes, it was what i wanted, thanks! Bug report (this post won't be completly useless so) : |
The flickering is from how the nearest item is found https://github.com/chartjs/Chart.js/blob/master/src/core/core.interaction.js#L56 Right now if two items are at the same distance to the mouse position, we find the smallest else we just pick the first one https://github.com/chartjs/Chart.js/blob/master/src/core/core.interaction.js#L213-L225 Maybe we need to find a better rule for that |
I understand. Is there a reason to pick the smallest rather than the highest or whatever ? if not, you can just pick the first dataset, it will be consistent. Edit: |
We chose smallest because it gives the best behaviour if the points have different radii. If we choose the larger one, it would become impossible to get the smaller point. Yup, the sort is the problem. Just throwing out solutions here:
|
I looked into this. The problem is that we sort by area first, then dataset index. What happens is that the hover increases the size, which then prioritizes the other point so we see them keep swapping. Not sure what the best solution to this is. Any ideas? |
Hi,
First of all, thanks for your great work on tooltips in 2.4 !
Now, for visual improvment, is it possible to trigger the hover event when a tooltip is shown on a point even if the cursor doesn't hover the point (intersect: false)?
Thanks!
The text was updated successfully, but these errors were encountered: