...
|
...
|
@@ -15,7 +15,8 @@ |
15
|
15
|
limitations under the License.
|
16
|
16
|
|
17
|
17
|
-->
|
18
|
|
-<table class="tb-legend">
|
|
18
|
+<table class="tb-legend" [ngClass]="isRowDirection ? 'tb-legend-row' : 'tb-legend-column'"
|
|
19
|
+ [ngStyle]="{ marginRight: isRowDirection && !displayHeader ? 'auto' : '20px' }">
|
19
|
20
|
<thead>
|
20
|
21
|
<tr class="tb-legend-header" *ngIf="!isRowDirection">
|
21
|
22
|
<th colspan="2"></th>
|
...
|
...
|
@@ -26,17 +27,54 @@ |
26
|
27
|
</tr>
|
27
|
28
|
</thead>
|
28
|
29
|
<tbody>
|
29
|
|
- <tr class="tb-legend-keys" *ngFor="let legendKey of legendKeys()" [ngClass]="{ 'tb-row-direction': isRowDirection }">
|
30
|
|
- <td><span class="tb-legend-line" [ngStyle]="{backgroundColor: legendKey.dataKey.color}"></span></td>
|
31
|
|
- <td class="tb-legend-label"
|
32
|
|
- (click)="toggleHideData(legendKey.dataIndex)"
|
33
|
|
- [ngClass]="{ 'tb-hidden-label': legendData.keys[legendKey.dataIndex].dataKey.hidden, 'tb-horizontal': isHorizontal }">
|
34
|
|
- {{ legendKey.dataKey.label }}
|
35
|
|
- </td>
|
36
|
|
- <td class="tb-legend-value" *ngIf="legendConfig.showMin === true">{{ legendData.data[legendKey.dataIndex].min }}</td>
|
37
|
|
- <td class="tb-legend-value" *ngIf="legendConfig.showMax === true">{{ legendData.data[legendKey.dataIndex].max }}</td>
|
38
|
|
- <td class="tb-legend-value" *ngIf="legendConfig.showAvg === true">{{ legendData.data[legendKey.dataIndex].avg }}</td>
|
39
|
|
- <td class="tb-legend-value" *ngIf="legendConfig.showTotal === true">{{ legendData.data[legendKey.dataIndex].total }}</td>
|
40
|
|
- </tr>
|
|
30
|
+ <ng-container *ngIf="!isRowDirection">
|
|
31
|
+ <tr class="tb-legend-keys" *ngFor="let legendKey of legendKeys()">
|
|
32
|
+ <td><span class="tb-legend-line" [ngStyle]="{backgroundColor: legendKey.dataKey.color}"></span></td>
|
|
33
|
+ <td class="tb-legend-label"
|
|
34
|
+ (click)="toggleHideData(legendKey.dataIndex)"
|
|
35
|
+ [ngClass]="{ 'tb-hidden-label': legendData.keys[legendKey.dataIndex].dataKey.hidden, 'tb-horizontal': isHorizontal }">
|
|
36
|
+ {{ legendKey.dataKey.label }}
|
|
37
|
+ </td>
|
|
38
|
+ <td class="tb-legend-value" *ngIf="legendConfig.showMin === true">{{ legendData.data[legendKey.dataIndex].min }}</td>
|
|
39
|
+ <td class="tb-legend-value" *ngIf="legendConfig.showMax === true">{{ legendData.data[legendKey.dataIndex].max }}</td>
|
|
40
|
+ <td class="tb-legend-value" *ngIf="legendConfig.showAvg === true">{{ legendData.data[legendKey.dataIndex].avg }}</td>
|
|
41
|
+ <td class="tb-legend-value" *ngIf="legendConfig.showTotal === true">{{ legendData.data[legendKey.dataIndex].total }}</td>
|
|
42
|
+ </tr>
|
|
43
|
+ </ng-container>
|
|
44
|
+ <tr *ngIf="isRowDirection" class="tb-legend-keys" [ngClass]="{ 'tb-row-direction': !displayHeader }">
|
|
45
|
+ <td></td>
|
|
46
|
+ <td *ngFor="let legendKey of legendKeys()">
|
|
47
|
+ <span class="tb-legend-line" [ngStyle]="{backgroundColor: legendKey.dataKey.color}"></span>
|
|
48
|
+ <span class="tb-legend-label"
|
|
49
|
+ (click)="toggleHideData(legendKey.dataIndex)"
|
|
50
|
+ [ngClass]="{ 'tb-hidden-label': legendData.keys[legendKey.dataIndex].dataKey.hidden}">
|
|
51
|
+ {{ legendKey.dataKey.label }}
|
|
52
|
+ </span>
|
|
53
|
+ </td>
|
|
54
|
+ </tr>
|
|
55
|
+ <tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showMin === true">
|
|
56
|
+ <td class="tb-legend-type">{{ 'legend.min' | translate }}</td>
|
|
57
|
+ <td class="tb-legend-value" *ngFor="let legendKey of legendKeys()">
|
|
58
|
+ {{ legendData.data[legendKey.dataIndex].min }}
|
|
59
|
+ </td>
|
|
60
|
+ </tr>
|
|
61
|
+ <tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showMax === true">
|
|
62
|
+ <td class="tb-legend-type">{{ 'legend.max' | translate }}</td>
|
|
63
|
+ <td class="tb-legend-value" *ngFor="let legendKey of legendKeys()">
|
|
64
|
+ {{ legendData.data[legendKey.dataIndex].max }}
|
|
65
|
+ </td>
|
|
66
|
+ </tr>
|
|
67
|
+ <tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showAvg === true">
|
|
68
|
+ <td class="tb-legend-type">{{ 'legend.avg' | translate }}</td>
|
|
69
|
+ <td class="tb-legend-value" *ngFor="let legendKey of legendKeys()">
|
|
70
|
+ {{ legendData.data[legendKey.dataIndex].avg }}
|
|
71
|
+ </td>
|
|
72
|
+ </tr>
|
|
73
|
+ <tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showTotal === true">
|
|
74
|
+ <td class="tb-legend-type">{{ 'legend.total' | translate }}</td>
|
|
75
|
+ <td class="tb-legend-value" *ngFor="let legendKey of legendKeys()">
|
|
76
|
+ {{ legendData.data[legendKey.dataIndex].total }}
|
|
77
|
+ </td>
|
|
78
|
+ </tr>
|
41
|
79
|
</tbody>
|
42
|
80
|
</table> |
...
|
...
|
|