I am currently building an Angular application to be hosted on the Cumulocity IoT platform, and I am trying to use Chart.js to generate custom bar charts. This did not work at first, so I did a little digging and discovered the special node package, ng2-chart, developed to employ Chart.js with Angular.
As it happens, I installed the latest version of each dependency, but I soon encountered errors trying to build and serve the application, among which is NG8002
that states:
Error: src/app/features/[..].component.html:81:17 - error NG8002: Can't bind to 'legend' since it isn't a known property of 'canvas'.
I did some research and found that this is likely due to the latest versions of Chart.js and ng2-chart being incompatible with my current development environment:
@angular/cli
: 14.2.12npm
: 6.14.18c8y/client
: 1016.0.324Has anyone else encountered this problem? What versions of Chart.js and ng2-chart could I use for my application?
i leave you a small image of the versions compatible with ng2-chart and an installation guide
Installation Guide