43 lines
2.1 KiB
HTML
43 lines
2.1 KiB
HTML
<!--
|
|
|
|
Copyright © 2016-2020 The Thingsboard Authors
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
|
|
-->
|
|
<table class="tb-legend">
|
|
<thead>
|
|
<tr class="tb-legend-header" *ngIf="!isRowDirection">
|
|
<th colspan="2"></th>
|
|
<th *ngIf="legendConfig.showMin === true">{{ 'legend.min' | translate }}</th>
|
|
<th *ngIf="legendConfig.showMax === true">{{ 'legend.max' | translate }}</th>
|
|
<th *ngIf="legendConfig.showAvg === true">{{ 'legend.avg' | translate }}</th>
|
|
<th *ngIf="legendConfig.showTotal === true">{{ 'legend.total' | translate }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="tb-legend-keys" *ngFor="let legendKey of legendData.keys" [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>
|
|
</tbody>
|
|
</table>
|