-
-
Notifications
You must be signed in to change notification settings - Fork 746
/
metric.component.ts
43 lines (38 loc) · 1.12 KB
/
metric.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {ChartOptions, ChartType} from 'chart.js';
import {MetricService} from './metric.service';
import {Color} from 'ng2-charts';
import {Observable} from 'rxjs';
import {LineChartData} from './metric.model';
import {fadeAnimation} from '../../ui/animations/fade.ani';
import {T} from '../../t.const';
@Component({
selector: 'metric',
templateUrl: './metric.component.html',
styleUrls: ['./metric.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [fadeAnimation],
})
export class MetricComponent {
T = T;
productivityHappiness$: Observable<LineChartData> = this.metricService.getProductivityHappinessChartData$();
pieChartOptions: ChartOptions = {
responsive: true,
legend: {
position: 'top',
},
};
pieChartType: ChartType = 'pie';
pieChartPlugins = [];
lineChartOptions: ChartOptions = {
responsive: true,
};
lineChartColors: Color[] = [];
lineChartLegend = true;
lineChartType: ChartType = 'line';
lineChartPlugins = [];
constructor(
public metricService: MetricService,
) {
}
}