No error occurs.
A linear chart is continuously updated every couple of seconds by assigning to it’s datasets and labels property before calling the update method using the following code:
const chartData = chart.data as LinearChartData; chartData.datasets = newData; chartData.labels = labels; chart.update(0);
After some hours of normal behavior an exception occurs in production:
TypeError: Cannot read property '_meta' of undefined at t.getDatasetMeta (https://localhost/vendor.bundle.js:1:236168) at t.updateHoverStyle (https://localhost/vendor.bundle.js:1:237714) at t.handleEvent (https://localhost/vendor.bundle.js:1:238496) at t.eventHandler (https://localhost/vendor.bundle.js:1:237904) at n (https://localhost/vendor.bundle.js:1:237275) at HTMLCanvasElement.s.(anonymous function) (https://localhost/vendor.bundle.js:1:170105) at e.invokeTask (https://localhost/polyfills.bundle.js:1:41200) at Object.onInvokeTask (https://localhost/vendor.bundle.js:1:45060) at e.invokeTask (https://localhost/polyfills.bundle.js:1:41121) at r.runTask (https://localhost/polyfills.bundle.js:1:36376)
The stack trace points toward a bug inside Chart.js.
Steps to Reproduce (for bugs)
I was unable to reproduce it in a development environment, it only happends sporadically in production after hours of usage.
The chart is used inside a monitoring application based on angular and contiuously updated.
It looks like an uncaught exception inside of Chart.js, which is crashing the application.
- Chart.js version: 2.6.0
- Browser name and version: 62.0.3202.94
- Angular Wrapper: ng2-charts 1.6.0