|
|
|
@ -15,7 +15,8 @@ |
|
|
|
limitations under the License. |
|
|
|
|
|
|
|
--> |
|
|
|
<table class="tb-legend"> |
|
|
|
<table class="tb-legend" [ngClass]="isRowDirection ? 'tb-legend-row' : 'tb-legend-column'" |
|
|
|
[ngStyle]="{ marginRight: isRowDirection && !displayHeader ? 'auto' : '20px' }"> |
|
|
|
<thead> |
|
|
|
<tr class="tb-legend-header" *ngIf="!isRowDirection"> |
|
|
|
<th colspan="2"></th> |
|
|
|
@ -26,17 +27,54 @@ |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tr class="tb-legend-keys" *ngFor="let legendKey of legendKeys()" [ngClass]="{ 'tb-row-direction': isRowDirection }"> |
|
|
|
<td><span class="tb-legend-line" [ngStyle]="{backgroundColor: legendKey.dataKey.color}"></span></td> |
|
|
|
<td class="tb-legend-label" |
|
|
|
(click)="toggleHideData(legendKey.dataIndex)" |
|
|
|
[ngClass]="{ 'tb-hidden-label': legendData.keys[legendKey.dataIndex].dataKey.hidden, 'tb-horizontal': isHorizontal }"> |
|
|
|
{{ legendKey.dataKey.label }} |
|
|
|
</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showMin === true">{{ legendData.data[legendKey.dataIndex].min }}</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showMax === true">{{ legendData.data[legendKey.dataIndex].max }}</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showAvg === true">{{ legendData.data[legendKey.dataIndex].avg }}</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showTotal === true">{{ legendData.data[legendKey.dataIndex].total }}</td> |
|
|
|
</tr> |
|
|
|
<ng-container *ngIf="!isRowDirection"> |
|
|
|
<tr class="tb-legend-keys" *ngFor="let legendKey of legendKeys()"> |
|
|
|
<td><span class="tb-legend-line" [ngStyle]="{backgroundColor: legendKey.dataKey.color}"></span></td> |
|
|
|
<td class="tb-legend-label" |
|
|
|
(click)="toggleHideData(legendKey.dataIndex)" |
|
|
|
[ngClass]="{ 'tb-hidden-label': legendData.keys[legendKey.dataIndex].dataKey.hidden, 'tb-horizontal': isHorizontal }"> |
|
|
|
{{ legendKey.dataKey.label }} |
|
|
|
</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showMin === true">{{ legendData.data[legendKey.dataIndex].min }}</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showMax === true">{{ legendData.data[legendKey.dataIndex].max }}</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showAvg === true">{{ legendData.data[legendKey.dataIndex].avg }}</td> |
|
|
|
<td class="tb-legend-value" *ngIf="legendConfig.showTotal === true">{{ legendData.data[legendKey.dataIndex].total }}</td> |
|
|
|
</tr> |
|
|
|
</ng-container> |
|
|
|
<tr *ngIf="isRowDirection" class="tb-legend-keys" [ngClass]="{ 'tb-row-direction': !displayHeader }"> |
|
|
|
<td></td> |
|
|
|
<td *ngFor="let legendKey of legendKeys()"> |
|
|
|
<span class="tb-legend-line" [ngStyle]="{backgroundColor: legendKey.dataKey.color}"></span> |
|
|
|
<span class="tb-legend-label" |
|
|
|
(click)="toggleHideData(legendKey.dataIndex)" |
|
|
|
[ngClass]="{ 'tb-hidden-label': legendData.keys[legendKey.dataIndex].dataKey.hidden}"> |
|
|
|
{{ legendKey.dataKey.label }} |
|
|
|
</span> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showMin === true"> |
|
|
|
<td class="tb-legend-type">{{ 'legend.min' | translate }}</td> |
|
|
|
<td class="tb-legend-value" *ngFor="let legendKey of legendKeys()"> |
|
|
|
{{ legendData.data[legendKey.dataIndex].min }} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showMax === true"> |
|
|
|
<td class="tb-legend-type">{{ 'legend.max' | translate }}</td> |
|
|
|
<td class="tb-legend-value" *ngFor="let legendKey of legendKeys()"> |
|
|
|
{{ legendData.data[legendKey.dataIndex].max }} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showAvg === true"> |
|
|
|
<td class="tb-legend-type">{{ 'legend.avg' | translate }}</td> |
|
|
|
<td class="tb-legend-value" *ngFor="let legendKey of legendKeys()"> |
|
|
|
{{ legendData.data[legendKey.dataIndex].avg }} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr class="tb-legend-keys" *ngIf="isRowDirection && legendConfig.showTotal === true"> |
|
|
|
<td class="tb-legend-type">{{ 'legend.total' | translate }}</td> |
|
|
|
<td class="tb-legend-value" *ngFor="let legendKey of legendKeys()"> |
|
|
|
{{ legendData.data[legendKey.dataIndex].total }} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
|