valor-software / ng2-charts

Beautiful charts for Angular based on Chart.js
http://valor-software.github.io/ng2-charts/
MIT License
2.34k stars 573 forks source link

Add Updated event #1311

Open dmoore1181 opened 3 years ago

dmoore1181 commented 3 years ago

Reproduction of the problem

ng2-charts is a port & modification of Chart.js component for Angular 2. Sometimes the issue is related with Chart.js instead of ng2-charts. To confirm, if the issue shows in a pure Chart.js project, it is a issue of Chart.js. Pure Chart.js starting template: https://jsfiddle.net/Hongbo_Miao/mvct2uwo/3/

If the issue does not show in a pure Chart.js project, and shows in a ng2-charts project, please try to provide a minimal demo of the problem. ng2-charts starting template: http://plnkr.co/edit/Ka4NXG3pZ1mXnaN95HX5?p=preview

I am using ng2-charts 2.4.2, chart.js 2.9.4, and angular 9.1.13. I want to add a suggestion to have an updated event that can be subscribed to. We have a use case where we need to maintain the current version of the base64 image and the only way I have found to do this so far is to add in a 1 second timeout to ensure that the chart is actually done updating (not fool proof and a little hacky).

ps: I was going to create a plunkr with your template, but the template isn't working.

santam85 commented 3 years ago

Will add this feature to v3.0