i\'m developing a web application - MEAN stack. i\'m trying to use ChartJS doughnut chart but i need it to be completely dynamic - first, the number of charts is dynamic (each c
In your
canvas ... add a #yourId
(example : canvas *ngFor="let chart of charts; let i = index" id="canvas{{i}} #yourId")
Then you can use @ViewChildren('yourId') myCharts: any; (you can't use myCharts in ngOnInit, only in ngAfterViewInit and after) which will give you your array of charts.
I won't provide much more detail but you can use what's inside your myCharts (use a console.log(myCharts) to see in detail what's in there), you can use this to change data and so on.
Hope this helps.