|
|
@ -61,6 +61,7 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit { |
|
|
public showDetails = false; |
|
|
public showDetails = false; |
|
|
public unit: string; |
|
|
public unit: string; |
|
|
public user: User; |
|
|
public user: User; |
|
|
|
|
|
private choice: string = 'netPerformanceInPercentageWithCurrencyEffect'; |
|
|
|
|
|
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
|
@ -131,14 +132,17 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit { |
|
|
this.errors = errors; |
|
|
this.errors = errors; |
|
|
this.performance = performance; |
|
|
this.performance = performance; |
|
|
|
|
|
|
|
|
this.historicalDataItems = chart.map( |
|
|
const multiplier = |
|
|
({ date, netPerformanceInPercentageWithCurrencyEffect }) => { |
|
|
this.choice === 'netPerformanceInPercentageWithCurrencyEffect' |
|
|
|
|
|
? 100 |
|
|
|
|
|
: 1; |
|
|
|
|
|
|
|
|
|
|
|
this.historicalDataItems = chart.map((item) => { |
|
|
return { |
|
|
return { |
|
|
date, |
|
|
date: item.date, |
|
|
value: netPerformanceInPercentageWithCurrencyEffect * 100 |
|
|
value: item[this.choice] * multiplier |
|
|
}; |
|
|
}; |
|
|
} |
|
|
}); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|
this.deviceType === 'mobile' && |
|
|
this.deviceType === 'mobile' && |
|
|
@ -155,4 +159,9 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit { |
|
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
this.changeDetectorRef.markForCheck(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public onMetricClick(selectedChoice: string): void { |
|
|
|
|
|
this.choice = selectedChoice; // update metric choice
|
|
|
|
|
|
this.update(); // rebuild historicalDataItems
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|