Accepted answer

i think ng2-charts might not play well with chart.js version 3.0.0+, try to install an older version: npm install chart.js@2.9.4 --save.

also, i'm not sure if your html has the basechart directive added (because the picture is cut with the error), it should look something like:


finally, here is a minimal example of adding chart.js to your application - stackblitz


you cant just bind your data to a canvas and think it will work, you will either have to use the bare lib correctly because im pretty sure chart.js doesnt expose an export called chartdatasetsee integration ( and usage ( guides to get started.

alternatively you can use the angular wrapper which is just a component where you can just supply your data to (


npm install ng2-charts

when we want to install this above command just write --force npm install ng2-charts --force in angular 13 command prompt go to package.json my version number is = "ng2-charts": "^2.4.3",

Related Query

More Query from same tag