show interval input field only for bar charts

This commit is contained in:
2020-04-05 09:33:05 +02:00
parent 3c88969885
commit aa9a4255ef
2 changed files with 8 additions and 4 deletions

View File

@@ -31,9 +31,9 @@
</mat-form-field>
<pdb-limit-by #limitbycomponent></pdb-limit-by>
<mat-form-field>
<mat-label>Intervals:</mat-label>
<div [hidden]="!selectedPlotTypesContains('BAR')">
<mat-form-field >
<mat-label>Intervals (only bar chart):</mat-label>
<mat-select [(value)]="intervalUnit">
<mat-option value="NO_INTERVAL">-</mat-option>
<mat-option value="MINUTE">minute</mat-option>
@@ -44,7 +44,7 @@
<mat-option value="YEAR">year</mat-option>
</mat-select>
</mat-form-field>
</div>
<pdb-y-axis-definition #y1AxisDefinitionComponent yIndex="1"></pdb-y-axis-definition>
<pdb-y-axis-definition #y2AxisDefinitionComponent yIndex="2" [hidden]="!y2AxisAvailable"></pdb-y-axis-definition>

View File

@@ -92,6 +92,10 @@ export class VisualizationPageComponent implements OnInit {
this.y2AxisAvailable = axesTypes.y.length == 2;
}
selectedPlotTypesContains(plotTypeId: string){
return this.selectedPlotType.filter(pt => pt.id == plotTypeId).length > 0;
}
dateRangeAsString() : string {
return (<HTMLInputElement>document.getElementById("search-date-range")).value;