Make the XAxis based hover/tooltip pick the item at the same x-axis v…#2980
Merged
simonbrunel merged 3 commits intochartjs:masterfrom Jul 27, 2016
jeffesp:master
Merged
Make the XAxis based hover/tooltip pick the item at the same x-axis v…#2980simonbrunel merged 3 commits intochartjs:masterfrom jeffesp:master
simonbrunel merged 3 commits intochartjs:masterfrom
jeffesp:master
Conversation
Contributor
Author
|
It looks like the failure above is due to the CI server rather than the code. All tests pass for me. Can this be merged? |
Member
|
I think this is fine to merge. |
src/core/core.controller.js
Outdated
| if (found._model.x === it._model.x) | ||
| item = it; | ||
| }; | ||
| meta.data.forEach(findByXCoord); |
Member
There was a problem hiding this comment.
We shouldn't iterate other all items here, but break as soon as one is found. You should maybe use a for loop or the helpers.findIndex instead.
Member
|
Sorry, merged before getting @zachpanz88 feedback, hope it's good for you :) Thanks @jeffesp. |
Contributor
Author
|
Sure. Thanks for the good feedback on using findIndex. Let me know if there's anything else to do here. |
Contributor
|
No worries, it looks good to me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intended to fix #2922 - even though it is closed, it looks like that might have been an error.
I reformatted this code as well as doing the fix. Sorry about that. If you want two commits, I can but this was all indented with spaces when I got it and it looks like every thing else uses tabs.
The key to this fix is in lines 453-459 where I look for the item by it's x value rather than by the index of the point in the data set.