我在我的
chart js
应用程序中实现了angular 9
。期望图表值不会出现。
ngOnInit:
ngOnInit(): void {
this.smdashboardservice.fetchSmDashboardData().subscribe(response=>{
//let data = response.data
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']);
});
})
}
但我很期待