I integrated Chart.JS into my Angular 9 application. However, the chart is not displaying as I expected.
ngOnInit(): void {
this.smdashboardservice.fetchSmDashboardData().subscribe(response=>{
let data = [
{"label":"Application","sublabel":"Nice","count":2},
{"label":"Application","sublabel":"poor","count":1},
{"label":"Channels","sublabel":"Quality","count":2},
{"label":"Customer Care","sublabel":"support","count":2}
]
this.barChartLabels = Object.keys(data);
this.barChartLabels.forEach(label => {
this.barChartData[0].data.push(data[label]['count']);
});
})
}
The current code displays the chart like this:
https://i.sstatic.net/2uMm7.png
However, I am aiming for a chart that looks like this: