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

Support "r" axis for non-intersecting interaction #9919

Merged
merged 10 commits into from Dec 5, 2021
Merged

Support "r" axis for non-intersecting interaction #9919

merged 10 commits into from Dec 5, 2021

Conversation

luukdv
Copy link
Contributor

@luukdv luukdv commented Nov 29, 2021

Fixes #9826.

@luukdv
Copy link
Contributor Author

luukdv commented Nov 29, 2021

Right now, adding a test in https://github.com/chartjs/Chart.js/blob/master/test/specs/core.interaction.tests.js for something like type: 'polarArea' and Chart.Interaction.modes.nearest(chart, evt, { axis: 'r', intersect: false }) will fail because of NaN values for various props (for example startAngle). Would be great if someone could give some pointers on the right way of setting up that ArcElement from this test, or how to do this differently.

@luukdv luukdv marked this pull request as ready for review November 29, 2021 12:31
@kurkle
Copy link
Member

kurkle commented Nov 29, 2021

I think the test you are trying to add is correct and should work. Could you just add it, so I can easily take a look?

@luukdv
Copy link
Contributor Author

luukdv commented Nov 29, 2021

I've pushed the failing WIP test.

@kurkle
Copy link
Member

kurkle commented Nov 29, 2021

I've pushed the failing WIP test.

getIndexAngle is based on number of labels, the chart has none. Adding labels fixes the elements, but it seems there is some other issue (the test hits 2 arcs).

@kurkle kurkle added this to the Version 3.7.0 milestone Nov 29, 2021
@luukdv
Copy link
Contributor Author

luukdv commented Nov 30, 2021

Thanks, that was the culprit. I also fixed the other issue (forgot to disable the legend).

@etimberg etimberg merged commit 7784fbf into chartjs:master Dec 5, 2021
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.

Interaction axis r support?
3 participants