Chartjs-Angular + Ng2 Charts: Chart not displaying as Child Component

3πŸ‘

βœ…

Can you please try with below code?

sample-chart.component.html

<div style="display: block;">
   <canvas
     baseChart
     [datasets]="barChartData"
     [labels]="barChartLabels"
     [options]="barChartOptions"
     [plugins]="barChartPlugins"
     [legend]="barChartLegend"
     [chartType]="barChartType"
   >
   </canvas>
</div>

You are forgot to add display block div. Can you please try with this in your chart.component.html

Leave a comment