emn178 / chartjs-plugin-labels

Plugin for Chart.js to display percentage, value or label in Pie or Doughnut.
MIT License
612 stars 219 forks source link

Not working on latest chartjs? (edit: working version inside) #140

Open DavideViolante opened 3 years ago

DavideViolante commented 3 years ago

Does it work on chartjs v3.2.1?

chartjs-plugin-labels.js:433 Uncaught TypeError: Cannot read property 'register' of undefined
    at chartjs-plugin-labels.js:433
    at chartjs-plugin-labels.js:490

edit

Working version here, install with: npm i chart.js-plugin-labels-dv

DavideViolante commented 3 years ago

I tried to replace Chart.plugins.register({ with Chart.register({, no error in console now, but is not working yet. Someone knows how to make it work on chartjs v3?

iamjoshhansen commented 3 years ago

Same issue. After running npm i chartjs-plugin-labels, I get the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ########
npm ERR! Found: chart.js@3.2.1
npm ERR! node_modules/chart.js
npm ERR!   chart.js@"^3.2.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer chart.js@"^2.6.0" from chartjs-plugin-labels@1.1.0
npm ERR! node_modules/chartjs-plugin-labels
npm ERR!   chartjs-plugin-labels@"*" from the root project
DavideViolante commented 3 years ago

Finally made it work with Chart.js v3 here: https://github.com/DavideViolante/chartjs-plugin-labels I don't even open a PR since I doubt it will be merged, this repo has no updates since 3 years... but I try to send an email to author.

edit: author doesnt reply.

edit: see diff here if you are curious.

letsgo247 commented 3 years ago

Finally made it work with Chart.js v3 here: https://github.com/DavideViolante/chartjs-plugin-labels I don't even open a PR since I doubt it will be merged, this repo has no updates since 3 years... but I try to send an email to author.

edit: author doesnt reply.

Thanks so much!

rizkyanfasafm commented 2 years ago

Finally made it work with Chart.js v3 here: https://github.com/DavideViolante/chartjs-plugin-labels I don't even open a PR since I doubt it will be merged, this repo has no updates since 3 years... but I try to send an email to author.

edit: author doesnt reply.

Thanks bro

jknaust commented 2 years ago

Finally made it work with Chart.js v3 here: https://github.com/DavideViolante/chartjs-plugin-labels I don't even open a PR since I doubt it will be merged, this repo has no updates since 3 years... but I try to send an email to author.

edit: author doesnt reply.

Thank you!!! I'm new to JavaScript and I thought I was doing something wrong, so thank you for saving my sanity!

deprincipia commented 1 year ago

Thanks bro, made my day! 👍🏻