score:1

i did a little bit different. instead of creating the canvas tag inside a *ngfor, i created the chart canvas dynamically at the component code.

const wrapper = document.getelementbyid('chart-wrapper');
const newcanvas = document.createelement('canvas');
newcanvas.id = metric.canvas;
wrapper.appendchild(newcanvas);
const ctx = (newcanvas as htmlcanvaselement).getcontext('2d');
this.linechart = new chart(ctx, chartoptions);

Related Query

More Query from same tag