reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 300 forks source link

Can't resolve 'chart.js' #220

Open Legendofire opened 6 years ago

Legendofire commented 6 years ago

I installed react-chartjs via NPM and when i try and use Pie i get the error Error Can't resolve 'chart.js' in '/home/a7meds3d/Documents/WorkSpace/MERN/CIOChatbot/node_modules/react-chartjs/lib'.

larsdouweschuitema commented 6 years ago

The documentation reads:

"You must also include chart.js and React as dependencies."

Run the following command: npm install --save chart.js

Legendofire commented 6 years ago

The error message was after I installed chart.js, maybe I installed chartjs not chart.js. Will test it again.

Tom-Gorup commented 6 years ago

@larsdouweschuitema This solved my problem. Thanks!

amineb01 commented 6 years ago

@larsdouweschuitema thank you !

gion commented 6 years ago

Why not add chart-js as an actual dependency in the package.json file?

javaProgrammer44 commented 5 years ago

Please add these in angular.json file "scripts": [ "node_modules/chart.js/dist/Chart.js", "node_modules/hammerjs/hammer.min.js" ],

kumarbitthal commented 5 years ago

Install missing charts dependencies: charts.js & angular2-chartsjs I installed it locally and it worked. Don't forget to import these in your code.