fixed es5 compatibility
This commit is contained in:
parent
009fa20b4a
commit
49ec42349e
2 changed files with 4 additions and 5 deletions
|
@ -135,8 +135,7 @@ export class DashboardCustomerComponent implements OnInit {
|
|||
week_5: data.purchases[5],
|
||||
week_6: data.purchases[6],
|
||||
};
|
||||
//this.maxPurchase = Math.max(...this.weekPurchaseList);
|
||||
this.maxPurchase = Object.values(this.weekPurchaseList).reduce((a,b) => {
|
||||
this.maxPurchase = Object.keys(this.weekPurchaseList).map(key => this.weekPurchaseList[key]).reduce((a,b) => {
|
||||
if (! a) { a = 0 }
|
||||
if (! b) { b = 0 }
|
||||
return Math.max(a,b);
|
||||
|
@ -144,8 +143,8 @@ export class DashboardCustomerComponent implements OnInit {
|
|||
}
|
||||
|
||||
public setSectorList (data: any) {
|
||||
this.sectorLetters = Object.values(data.sectors);
|
||||
this.sectorPurchases = Object.values(data.purchases);
|
||||
this.sectorLetters = Object.keys(data.sectors).map(key => data.sectors[key]);
|
||||
this.sectorPurchases = Object.keys(data.purchases).map(key => data.purchases[key]);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
@ -29,7 +29,7 @@ export class PiePanel implements OnInit {
|
|||
}
|
||||
|
||||
private setData(data: any) {
|
||||
this.doughnutChartData = Object.values(data);
|
||||
this.doughnutChartData = Object.keys(data).map(key => data[key]);
|
||||
// setTimeout is currently a workaround for ng2-charts labels
|
||||
setTimeout(() => this.doughnutChartLabels = Object.keys(data), 0);
|
||||
}
|
||||
|
|
Reference in a new issue