[Chartjs]-How to use chart.js in angular

1๐Ÿ‘

โœ…

You need to wrap <app-chartjs></app-chartjs> inside *ngIf or simply try this in <app-chartjs>

<div [hidden]="!chart">
    <canvas class="my-4 w-100" id="canvas" width="900" height="380">{{chart}}</canvas>
</div>

1๐Ÿ‘

you have to create the new chart only in ngAfterViewInit()

Leave a comment