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

[2.9] Incorrect labels when using object dataset #7854

Closed

Conversation

alessandroasm
Copy link

When using object datasets, labels are displayed incorrectly because they are retrieved based on item index instead of the corresponding x or y property.

Also I created test cases for this issue.

Fixes #7839

@kbansal77
Copy link

i would like to contribute

@kurkle
Copy link
Member

kurkle commented Oct 7, 2020

You'll need to find a way to get the gulp docs passing to be able to update 2.9 branch.

@alessandroasm
Copy link
Author

I opened #7863 to track this issue, since it affects PR #7853 too.

@kurkle kurkle changed the title Incorrect labels when using object dataset [2.9] Incorrect labels when using object dataset Oct 8, 2020
When using object datasets, labels are displayed incorrect because they are
retrieved based on item index instead of the corresponding x or y property.

Fixes chartjs#7839
@alessandroasm
Copy link
Author

Hello! I pushed the changes to make gulp docs pass. Should I do anything else?
Thanks!

@kurkle
Copy link
Member

kurkle commented Oct 9, 2020

Isn't the same possible by just configuring the right mode ('x' or 'y')?
index mode in my opinion should work by index rather that the coordinates.

@alessandroasm
Copy link
Author

Hi, I made a jsfiddle reproducing the issue. When you hover the point, the tooltip shows the incorrect month; that happens because it looks for the label data using the item index instead of the x / y property.

Could you elaborate on the mode configuration you mentioned?

https://jsfiddle.net/g5zcL2bu/

@kurkle
Copy link
Member

kurkle commented Oct 12, 2020

I was referring to the changes to the interaction modes, that seems unneeded to me.

See: https://jsfiddle.net/kc26bnzy/ where I just replaced the getLabelForIndex of category scale and used 'x' mode for tooltip.

@alessandroasm
Copy link
Author

That's an interesting solution, but isn't it more like a workaround? With this PR, we would have exactly the same result out of the box

@kurkle
Copy link
Member

kurkle commented Oct 13, 2020

Let me try to be more clear:

Why is the change needed for index interaction mode?

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

Successfully merging this pull request may close these issues.

None yet

3 participants