fix loading error on chart rental-time

This commit is contained in:
tim-herbst 2021-01-02 16:29:06 +01:00
parent 16468ba950
commit bd21861368
2 changed files with 8 additions and 11 deletions

View File

@ -102,7 +102,7 @@ export class RentTimeChartComponent implements OnInit {
}, },
chart: { chart: {
toolbar: { toolbar: {
show: true show: false
}, },
type: 'line', type: 'line',
height: '495', height: '495',
@ -119,20 +119,14 @@ export class RentTimeChartComponent implements OnInit {
}, },
legend: { legend: {
show: true, show: true,
offsetY: 8,
itemMargin: {
horizontal: 5
}
}, },
xaxis: { xaxis: {
title: { title: {
text: 'time of the day', text: 'time of the day'
offsetY: 17
}, },
categories: source.map(value => value.timeFrame), categories: source.map(value => value.timeFrame),
tickAmount: 24, tickAmount: 24,
tickPlacement: 'between', tickPlacement: 'between'
type: 'category'
}, },
yaxis: [{ yaxis: [{
title: { title: {
@ -154,7 +148,7 @@ export class RentTimeChartComponent implements OnInit {
} }
}; };
}); });
await this.chart.updateOptions(this.chartOptions);
} }
async onSubmit(actualStartDate: string, actualEndDate: string): Promise<void> { async onSubmit(actualStartDate: string, actualEndDate: string): Promise<void> {

View File

@ -36,7 +36,6 @@ export class TableComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.route.params.subscribe(params => { this.route.params.subscribe(params => {
this.selectionModel.clear();
this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red']; this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red'];
this.service.fetchDashboardInit(params.id).then(data => { this.service.fetchDashboardInit(params.id).then(data => {
this.bikePoint = data; this.bikePoint = data;
@ -48,6 +47,8 @@ export class TableComponent implements OnInit {
} }
async initTable(): Promise<void> { async initTable(): Promise<void> {
this.selectionModel.clear();
this.map.removeTableStationMarkerOnReload();
const initDate = this.maxEndDate.toISOString().substring(0, 10); const initDate = this.maxEndDate.toISOString().substring(0, 10);
await this.service.fetchDashboardStationTo(this.bikePoint.id, initDate, initDate).then(source => { await this.service.fetchDashboardStationTo(this.bikePoint.id, initDate, initDate).then(source => {
this.stationToSource = this.setBikePointColorToSource(source); this.stationToSource = this.setBikePointColorToSource(source);
@ -60,6 +61,8 @@ export class TableComponent implements OnInit {
} }
async onSubmit(actualStartDate: string, actualEndDate: string): Promise<void> { async onSubmit(actualStartDate: string, actualEndDate: string): Promise<void> {
this.selectionModel.clear();
this.map.removeTableStationMarkerOnReload();
await this.service.fetchDashboardStationTo(this.bikePoint.id, actualStartDate, actualEndDate).then((source) => { await this.service.fetchDashboardStationTo(this.bikePoint.id, actualStartDate, actualEndDate).then((source) => {
this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red']; this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red'];
this.stationToSource = this.setBikePointColorToSource(source); this.stationToSource = this.setBikePointColorToSource(source);