-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[ Line Chart ] Line chart does not handle datapoints created with the Number constructor #3124
Comments
I think we should gracefully handle this case. I'm not sure why anyone would create a number using One thing we may also want to test is using Typed arrays for the data to the chart. I don't think we do any specific to check that the data array is an array ( |
Re: Re: Typed arrays : I don't know if we have to specifically handle Even though, it might be better to just ask for an |
Should be fixed by #5752. |
Data points created with the Number constructor (ex:
new Number(...)
) :typeof (new Number())
yields"object"
, thusChart.controllers.line.updateElement
andChart.Scale.getRightValue
treat those values as{ x: ..., y: ... }
objects and skip them (becausex
andy
areundefined
).If I hack those functions to consider
... instanceof Number
the same astypeof ... === 'number'
, the data points are correctly displayed.Should we try to handle this kind of (edge?) case ? Other chart types do seem to accept Number objects (tested a radar chart).
The text was updated successfully, but these errors were encountered: