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
My version is 2.0.0-beta2.
I am adding datasets dynamically by config.data.datasets[1] = ... or config.data.datasets.push(... in a Time Scale chart but having this error when updating:
TypeError: Cannot read property '0' of undefined
at Chart.Scale.extend.getLabelMoment (Chart.js:6365)
at Chart.Scale.extend.getPixelForValue (Chart.js:6536)
at Chart.controllers.line.Chart.DatasetController.extend.updateElement (Chart.js:4849)
at null.<anonymous> (Chart.js:4777)
at Object.helpers.each (Chart.js:155)
at update (Chart.js:4776)
at helpers.extend.reset (Chart.js:1796)
at null.<anonymous> (Chart.js:1416)
at Object.helpers.each (Chart.js:155)
at buildOrUpdateControllers (Chart.js:1402)
It can be easily reproduced in /samples/timeScale/line-time-scale.html by clicking "Add Dataset"
My workaround is to create empty datasets in advance, however, this can only be done by modifying the data attribute instead of assigning the whole dataset.
i.e. this works without error: config.data.datasets[1].data = [...
but this doesn't: config.data.datasets[1] = {data: [...
and the error:
TypeError: Cannot read property 'diff' of undefined
at Chart.Scale.extend.getPixelForValue (Chart.js:6537)
at Chart.controllers.line.Chart.DatasetController.extend.updateElement (Chart.js:4849)
at null.<anonymous> (Chart.js:4777)
at Object.helpers.each (Chart.js:155)
at update (Chart.js:4776)
at helpers.extend.reset (Chart.js:1796)
at null.<anonymous> (Chart.js:1416)
at Object.helpers.each (Chart.js:155)
at buildOrUpdateControllers (Chart.js:1402)
at update (Chart.js:1442)
Thank you!
The text was updated successfully, but these errors were encountered:
Thanks for this awesome library!
My version is 2.0.0-beta2.
I am adding datasets dynamically by
config.data.datasets[1] = ...
orconfig.data.datasets.push(...
in a Time Scale chart but having this error when updating:It can be easily reproduced in
/samples/timeScale/line-time-scale.html
by clicking "Add Dataset"My workaround is to create empty datasets in advance, however, this can only be done by modifying the
data
attribute instead of assigning the whole dataset.i.e. this works without error:
config.data.datasets[1].data = [...
but this doesn't:
config.data.datasets[1] = {data: [...
and the error:
Thank you!
The text was updated successfully, but these errors were encountered: