From bd21861368aefb66eb8990e85b06b3bca9b4e8a8 Mon Sep 17 00:00:00 2001 From: tim-herbst Date: Sat, 2 Jan 2021 16:29:06 +0100 Subject: [PATCH] fix loading error on chart rental-time --- .../rent-time-chart/rent-time-chart.component.ts | 14 ++++---------- .../src/app/dashboard/table/table.component.ts | 5 ++++- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/projects/project-3/frontend/src/app/dashboard/rent-time-chart/rent-time-chart.component.ts b/projects/project-3/frontend/src/app/dashboard/rent-time-chart/rent-time-chart.component.ts index 8f4c881..39aa370 100644 --- a/projects/project-3/frontend/src/app/dashboard/rent-time-chart/rent-time-chart.component.ts +++ b/projects/project-3/frontend/src/app/dashboard/rent-time-chart/rent-time-chart.component.ts @@ -102,7 +102,7 @@ export class RentTimeChartComponent implements OnInit { }, chart: { toolbar: { - show: true + show: false }, type: 'line', height: '495', @@ -119,20 +119,14 @@ export class RentTimeChartComponent implements OnInit { }, legend: { show: true, - offsetY: 8, - itemMargin: { - horizontal: 5 - } }, xaxis: { title: { - text: 'time of the day', - offsetY: 17 + text: 'time of the day' }, categories: source.map(value => value.timeFrame), tickAmount: 24, - tickPlacement: 'between', - type: 'category' + tickPlacement: 'between' }, yaxis: [{ title: { @@ -154,7 +148,7 @@ export class RentTimeChartComponent implements OnInit { } }; }); - await this.chart.updateOptions(this.chartOptions); + } async onSubmit(actualStartDate: string, actualEndDate: string): Promise { diff --git a/projects/project-3/frontend/src/app/dashboard/table/table.component.ts b/projects/project-3/frontend/src/app/dashboard/table/table.component.ts index 0e6f0ea..e77992e 100644 --- a/projects/project-3/frontend/src/app/dashboard/table/table.component.ts +++ b/projects/project-3/frontend/src/app/dashboard/table/table.component.ts @@ -36,7 +36,6 @@ export class TableComponent implements OnInit { ngOnInit(): void { this.route.params.subscribe(params => { - this.selectionModel.clear(); this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red']; this.service.fetchDashboardInit(params.id).then(data => { this.bikePoint = data; @@ -48,6 +47,8 @@ export class TableComponent implements OnInit { } async initTable(): Promise { + this.selectionModel.clear(); + this.map.removeTableStationMarkerOnReload(); const initDate = this.maxEndDate.toISOString().substring(0, 10); await this.service.fetchDashboardStationTo(this.bikePoint.id, initDate, initDate).then(source => { this.stationToSource = this.setBikePointColorToSource(source); @@ -60,6 +61,8 @@ export class TableComponent implements OnInit { } async onSubmit(actualStartDate: string, actualEndDate: string): Promise { + this.selectionModel.clear(); + this.map.removeTableStationMarkerOnReload(); await this.service.fetchDashboardStationTo(this.bikePoint.id, actualStartDate, actualEndDate).then((source) => { this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red']; this.stationToSource = this.setBikePointColorToSource(source);