mykola-digtiar / chartjs-plugin-piechart-outlabels

Highly customizable Chart.js plugin that displays labels outside the pie/doughnut chart.
https://piechart-outlabels.netlify.com/sample/
MIT License
51 stars 37 forks source link

Not compatible with Version >3 of ChartJS #32

Open advissor opened 1 year ago

advissor commented 1 year ago

Not compatible with Version >3 of ChartJS

RR! Found: chart.js@4.2.1
npm ERR! node_modules/chart.js

npm ERR! Could not resolve dependency:

npm ERR! **peer chart.js@">= 2.7.0 < 3"** from chartjs-plugin-piechart-outlabels@0.1.4
npm ERR! node_modules/chartjs-plugin-piechart-outlabels

npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
hjk2022 commented 1 year ago

import PieChartOutLabels from 'chartjs-plugin-piechart-outlabels'; generates error:

TS7016: Could not find a declaration file for module 'chartjs-plugin-piechart-outlabels'. 'C:/project/node_modules/chartjs-plugin-piechart-outlabels/dist/chartjs-plugin-piechart-outlabels.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/chartjs-plugin-piechart-outlabels` if it exists or add a new declaration (.d.ts) file containing `declare module 'chartjs-plugin-piechart-outlabels';`

After created a typings folder, added chartjs-plugin-piechart-outlabels.d.ts with content: declare module 'chartjs-plugin-piechart-outlabels';

Made sure tsconfig.app.json has "include": ["src/**/*.d.ts"].

Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'merge')
TypeError: Cannot read properties of undefined (reading 'merge')
at chartjs-plugin-piechart-outlabels.js:22:25
at chartjs-plugin-piechart-outlabels.js:11:65
at 2818 (chartjs-plugin-piechart-outlabels.js:10:2)