put y axis definition into its own object

This commit is contained in:
2020-02-09 17:16:27 +01:00
parent ed7cc9bee5
commit 859491e99e
28 changed files with 268 additions and 324 deletions

View File

@@ -28,19 +28,23 @@ export class VisualizationPageComponent implements OnInit {
groupBy = new Array<TagField>();
@ViewChild(LimitByComponent, {static: false})
@ViewChild('limitbycomponent', {static: false})
private limitbycomponent : LimitByComponent;
@ViewChild(YAxisDefinitionComponent, {static: false})
private yAxisDefinitionComponent : YAxisDefinitionComponent;
@ViewChild(QueryAutocompleteComponent, {static: false})
@ViewChild('y1AxisDefinitionComponent', {static: false, read: YAxisDefinitionComponent})
private y1AxisDefinitionComponent : YAxisDefinitionComponent;
@ViewChild('y2AxisDefinitionComponent', {static: false, read: YAxisDefinitionComponent})
private y2AxisDefinitionComponent : YAxisDefinitionComponent;
@ViewChild('query', {static: false})
query: QueryAutocompleteComponent;
@ViewChild(PlotViewComponent, {static: false})
@ViewChild('plotView', {static: false})
plotView: PlotViewComponent;
@ViewChild(GalleryViewComponent, {static: false})
@ViewChild('galleryView', {static: false})
galleryView: GalleryViewComponent;
enableGallery = false;
@@ -139,11 +143,8 @@ export class VisualizationPageComponent implements OnInit {
const aggregates = [];
this.selectedPlotType.forEach(a => aggregates.push(a.id));
const y1 = new YAxisDefinition();
y1.axisScale = this.yAxisDefinitionComponent.yAxisScale;
y1.yRangeMin = this.yAxisDefinitionComponent.minYValue;
y1.yRangeMax = this.yAxisDefinitionComponent.maxYValue;
y1.yRangeUnit = this.yAxisDefinitionComponent.yAxisUnit;
const y1 = this.y1AxisDefinitionComponent.getAxisDefinition();
const y2 = this.y2AxisDefinitionComponent.getAxisDefinition();
const request = new PlotRequest();
request.query = this.query.query;
@@ -153,6 +154,7 @@ export class VisualizationPageComponent implements OnInit {
request.limitBy = this.limitbycomponent.limitBy;
request.limit = this.limitbycomponent.limit;
request.y1 = y1;
request.y2 = y2;
request.dateRange = this.dateRangeAsString();
request.aggregates = aggregates;
request.keyOutside = false;