getElementsAtEventForMode - clarity required #11549
Unanswered
PaulIsaac-MakaraHealth
asked this question in
Q&A
Replies: 1 comment
-
Perhaps this might help: https://youtu.be/5HATqPEL2Ro |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm attempting to have an onClick event return which arc of a Polar chart was clicked. Having tried seemingly every type of "interactionMode" I'm at a loss for why the function always returns an empty array. Firstly, it would help to know what it's supposed to return:
This page states:
https://www.chartjs.org/docs/latest/developers/api.html#getelementsateventformode-e-mode-options-usefinalposition
This page states:
https://www.chartjs.org/docs/latest/api/classes/Chart.html#getelementsateventformode
In theory, if it were to return something at some point, which would I get? And singular or plural?
Additionally, passing the modes "x" or "y" (listed as legit modes on /docs/latest/configuration/interactions.html#modes)
result in an error: chart.umd.min.js:1 Uncaught TypeError: t[o] is not a function. If specific chart types disallow specific interactionModes, is it planned to document what's permissible?
Codepen here:
https://codepen.io/pi2023/pen/dywxEWg
I have only found working examples of this type of functionality it older versions of Chart.js - I promise I have looked.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions