I have an Angular 7 (Ionic 4) project, where I trying out Chart.js and need to be able to custom draw some labels on a Pie chart, as I Have asked here.
I have been told I need to use a separate package for this, but I cannot get the import working for an Angular project, using the npm package.
I have the following version:
"chart.js": "^2.8.0",
"chartjs-plugin-datalabels": "^0.6.0",
....
"@angular/*": "^7.2.2",
"typescript": "~3.1.6"
I have tried as suggested here, but I get two errors.
First vscode gives the the following error:
Also, added the extra as described here.
Elsewhere, it is said to import as follows:
import 'chartjs-plugin-datalabels';
But I then get the compile error:
`[ng] ERROR in node_modules/chartjs-plugin-datalabels/types/index.d.ts(5,16): error TS2665: Invalid module name in augmentation. Module 'chart.js' resolves to an untyped module at 'D:/dev/ionic/chartjstest/node_modules/chart.js/dist/Chart.js', which cannot be augmented.`
How can I get this working?