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