93Alliance / ng-chartjs

A fully functional Angular2+ chart.js library.
https://93alliance.github.io/ng-chartjs/
MIT License
87 stars 10 forks source link

Issue with type definitions #28

Open Lizard-King101 opened 3 years ago

Lizard-King101 commented 3 years ago

Chart namespace is not a type causing the issue with the example to not work.

ERROR in node_modules/ng-chartjs/lib/ng-chartjs.directive.d.ts:18:21 - error TS2694: Namespace '"C:/Users/SiliconSwamp/Documents/apps/kompwnd-frontend/node_modules/chart.js/types/index.esm"' has no exported member 'ChartDataSets'.

18     datasets: Chart.ChartDataSets[];
                       ~~~~~~~~~~~~~
node_modules/ng-chartjs/lib/ng-chartjs.directive.d.ts:37:12 - error TS2709: Cannot use namespace 'Chart' as a type.

37     chart: Chart;
              ~~~~~
eagerowl commented 3 years ago

Seems like a versioning issue that's very recent. I fixed it by using the following versions:

npm install chart.js@2.9.4 --save npm install @types/chart.js@2.9.31

I picked these versions as I successfully used them about 4 weeks ago on another project.