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

hover is not working in v2.7.0 #4747

Closed
DurgpalSingh opened this issue Sep 12, 2017 · 7 comments
Closed

hover is not working in v2.7.0 #4747

DurgpalSingh opened this issue Sep 12, 2017 · 7 comments
Milestone

Comments

@DurgpalSingh
Copy link

DurgpalSingh commented Sep 12, 2017

Current Behavior

When I am using hover: { mode: 'x-axis' }, tooltips: { mode: 'x-axis' },

It is working in 2.6.0 but not working in 2.7.0

Fiddle for 2.6.0
https://jsfiddle.net/657fxL8r/4/

Fiddle for 2.7.0
https://jsfiddle.net/657fxL8r/5/

Environment

  • Chart.js 2.7.0:
@DurgpalSingh DurgpalSingh changed the title hover is not working in 2.7.0 hover is not working in v2.7.0 Sep 12, 2017
@etimberg
Copy link
Member

Looks like the intersect: false stuff isn't working in your sample, but I don't know why yet. It works in our samples.

@etimberg etimberg added this to the Version 2.8 milestone Sep 12, 2017
@etimberg
Copy link
Member

This is caused by 889ecd5#diff-de7249441169d0e646c53d8220e8b0c5R614. I think intersect should have been false rather than true.

Recommended solution since 'x-axis' is only kept for backwards compatibility set mode to 'index' and set intersect: false https://jsfiddle.net/657fxL8r/6/

@DurgpalSingh
Copy link
Author

Thanks for the solution @etimberg

@simonbrunel
Copy link
Member

simonbrunel commented Sep 13, 2017

@etimberg it comes from #4458 (this change) where intersect is explicitly true. It worked before 2.7 because there was a typo in #3400, where true was given instead of an object (options) and so true.intersect was undefined.

Note that 'x-axis' doesn't use the given options and so {intersect: true} in getElementsAtXAxis is ignored.

@etimberg
Copy link
Member

Good find @simonbrunel. I think in this case we can say this is not a bug as the old behaviour was the problem.

@simonbrunel
Copy link
Member

The doc says:

Behaves like 'index' mode with intersect = false.

What was the behavior before 2.4.0? I think it was similar to 'index' + intersect: false, in which case 2.7.0 doesn't provide the correct behavior and should be fixed.

@etimberg
Copy link
Member

I think that was the behaviour before 2.4 so we should fix this

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

No branches or pull requests

3 participants