-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
I have a <Line> chart in my React app.
Since I updated chart.js to v4.0.1, I get the following error when I unmount my chart:
Uncaught TypeError: Cannot set properties of null (setting '_setStyle')
at chartjs-plugin-streaming.esm.js:787:1
at each (helpers.core.ts:149:1)
at Chart.update (chartjs-plugin-streaming.esm.js:785:1)
at chartjs-plugin-streaming.esm.js:601:1
at callback (helpers.core.ts:109:1)
at chartjs-plugin-streaming.esm.js:68:1
This error is triggered repeatedly and infinitely. It seems that some kind of timer has not been cleared.
Here's my code:
<Line
data={{datasets}}
options={{
scales: {
x: {
display: false,
realtime: {
delay: 1000,
onRefresh: (chart) => {
const x = Date.now();
const y = getY();
chart.data.datasets.forEach((dataset, i) => {
dataset.data.push({
x,
y: y[i]
});
});
}
},
type: 'realtime'
},
y: yOptions
}
}} />
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels