Code: Select all
[
{
"status_counts": [
{
"status": "FAILURE",
"count": 1
},
{
"status": "SUCCESS",
"count": 1
}
],
"month": 8
}
]
Code: Select all
data_monthly: { datasets: any[], labels: any[] } = { datasets: [], labels: [] };
this.dashboardService.getStatByProjectIdByMonth(this.id).subscribe((data) => {
this.data_monthly = {
datasets: [
data.map(a => a.status_counts.forEach(obj => {
{
label => obj.status;
data => obj.count;
backgroundColor => '#42A5F5';
}
}))],
labels: data.map(a => a.month)
};
});
I debugged in my opera console and i'm sure that the data is received in getStatByProjectIdByMonth.