Chartjs-Graphs sharing datasets in chartjs

0👍

In your case, the charts won’t share the same labels and data, they both keep their own configuration object. This is basically the following part of your code:

{
  type: `line`,
  data: data,
}

Therefore, you’ll have to update labels and data contained in each chart configuration object and invoke chart.update() afterwards, same as you do in the code shown in your question: Chart.js not updating multiple charts independently.

Leave a comment