You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using this package for an app where data is
dynamically loaded and visualized as a user zooms in. I recently switched from interaction: {mode: 'index'} to interaction: {mode: 'x'} to improve chart interactions. This broke my app :(. Through a ton of debugging I found my main issue was with the function evaluateAllVisibleItems:
In my application, I am rendering timestamped data. Each dataset may not have the same timestamps in them, but they all overlap and are displayed on the same chart. The process chartjs uses to convert datasets into PointElements seems to create a ton of PointElements with all undefined fields. When evaluateAllVisibleItems is called. since PointElement.skipped will be undefined in some data values, a PointElement with undefined fields will pass the if statement highlighted above and make it into the handler. Somewhere down the function tree, the element with undefined fields will have its fields indexed causing an index error.
A proposed solution would be:
Let me know if there are any other workarounds to this issue. I am currently using the latest release of chartjs (version 3.7.1)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Chartjs,
I am currently using this package for an app where data is
dynamically loaded and visualized as a user zooms in. I recently switched from
interaction: {mode: 'index'}
tointeraction: {mode: 'x'}
to improve chart interactions. This broke my app :(. Through a ton of debugging I found my main issue was with the functionevaluateAllVisibleItems
:In my application, I am rendering timestamped data. Each dataset may not have the same timestamps in them, but they all overlap and are displayed on the same chart. The process chartjs uses to convert datasets into
PointElements
seems to create a ton ofPointElements
with all undefined fields. WhenevaluateAllVisibleItems
is called. sincePointElement.skipped
will beundefined
in some data values, aPointElement
with undefined fields will pass the if statement highlighted above and make it into the handler. Somewhere down the function tree, the element with undefined fields will have its fields indexed causing an index error.A proposed solution would be:

Let me know if there are any other workarounds to this issue. I am currently using the latest release of chartjs (version 3.7.1)
Beta Was this translation helpful? Give feedback.
All reactions