Chartjs-Angular, Chart.js animation inside mat-tab

3👍

You need to use <ng-template matTabContent>

It wiil look something like that:

<mat-tab label="example">
   <ng-template matTabContent>
    <div class="chart-area">
      <canvas baseChart
            [chartType]="'bar'"
            [datasets]="[chartConfig.chartData]"
            [labels]="chartConfig.chartHours"
            [options]="chartConfig.chartOptions"
            [colors]="[chartConfig.chartColors]">
      </canvas>
    </div>
   </ng-template>
</mat-tab>

You can read more about Lazy loading here

Leave a comment