Fix #3379 by making the x-axis mode behave more like label mode#3380
Fix #3379 by making the x-axis mode behave more like label mode#3380amir-hadzic wants to merge 1 commit intochartjs:masterfrom
Conversation
|
This should probably have a test if possible |
|
@simonbrunel thanks for the feedback, I wasn't sure why that was there in the first place. The problem with changes done by #2980 is that it compares by X coordinates, not by X value. If you can point me in the right direction, I can filter elements by their X value but I'm not sure what is the best way to do that to cover all chart types. |
|
I'm not sure we should change the Actually, I'm thinking we should add a new |
|
@amir-hadzic I have been working on this in my interaction enhancements. Here's what you are looking for using the new |
|
@etimberg Oh nice, that looks like exactly what we would need. Is that on some public branch somewhere? Let me know when it's ready for some testing, I can run it through the many different chart type combinations we have. |
|
https://github.com/chartjs/Chart.js/tree/v2.4-tooltips Note, I'll be doing some more refactoring and there aren't any doc updates. At the moment the available modes are: 'single', 'label', 'dataset', 'x-axis'. they behave like before New modes are
All modes also support a configurable options: {
hover: {
mode: 'index',
intersect: true // only triggers the mode when you intersect an element
}
}In your case you want options: {
tooltips: {
mode: 'index',
intersect: false
}
} |
|
Closing as similar work was done in #3400 |

Not sure if this is the best way to fix this, I'm open to any suggestions but this should fix #3379. Please see the issue description for a jsfiddle with this fix applied.