[Chartjs]-Chart.js has no exported member named 'ChartDataSets'. Did you mean 'ChartDataset'? ts(2724)

1๐Ÿ‘

โœ…

Install type chart

npm install @types/chart.js

5๐Ÿ‘

That happened because of version incompatibility. Try to change ChartDataSets to ChartDataSet.

Here is working sample on StackBlitz

Also you can see this

2๐Ÿ‘

"ng2-charts": "^2.4.2", "chart.js": "^2.9.3",

1๐Ÿ‘

you need to upgrade the version:

   "chart.js": "^4.0.0",
    "react-chartjs-2": "^5.0.0",

see here: https://codesandbox.io/s/github/reactchartjs/react-chartjs-2/tree/master/sandboxes/doughnut/default?from-embed=&file=/package.json

Package JSON file.

Leave a comment