diff --git a/projects/project-3/frontend/src/app/dashboard/dashboard.component.ts b/projects/project-3/frontend/src/app/dashboard/dashboard.component.ts index 2bb46e7..2815884 100644 --- a/projects/project-3/frontend/src/app/dashboard/dashboard.component.ts +++ b/projects/project-3/frontend/src/app/dashboard/dashboard.component.ts @@ -112,12 +112,11 @@ export class DashboardComponent implements OnInit { numbers.push(value.number); minutesGroup.push(value.minutesGroup); }); - this.durationChartOptions = { series: [ { name: 'borrow-duration', - data: [...numbers] + data: [numbers[0], numbers[4], numbers[1], numbers[2], numbers[3]] } ], chart: { @@ -140,7 +139,7 @@ export class DashboardComponent implements OnInit { colors: ['transparent'] }, xaxis: { - categories: [...minutesGroup] + categories: [minutesGroup[0], minutesGroup[4], minutesGroup[1], minutesGroup[2], minutesGroup[3]] }, yaxis: { title: { @@ -163,23 +162,22 @@ export class DashboardComponent implements OnInit { this.stationToSource = source; this.changeDetectorRefs.detectChanges(); }); - this.service.fetch_dashboard_station_from(this.station.id, this.actualStartDate.toISOString().substring(0, 10), this.actualStartDate.toISOString().substring(0, 10)).then((source) => { + this.service.fetch_dashboard_station_from(this.station.id, this.actualStartDate.toISOString().substring(0, 10), this.actualEndDate.toISOString().substring(0, 10)).then((source) => { this.stationFromSource = source; this.changeDetectorRefs.detectChanges(); }); - this.service.fetch_dashboard_station_duration(this.station.id, this.actualStartDate.toISOString().substring(0, 10), this.actualStartDate.toISOString().substring(0, 10)).then((source) => { + this.service.fetch_dashboard_station_duration(this.station.id, this.actualStartDate.toISOString().substring(0, 10), this.actualEndDate.toISOString().substring(0, 10)).then((source) => { const numbers = []; const minutesGroup = []; source.forEach(value => { numbers.push(value.number); minutesGroup.push(value.minutesGroup); }); - this.durationChartOptions = { series: [ { name: 'borrow-duration', - data: [...numbers] + data: [numbers[0], numbers[4], numbers[1], numbers[2], numbers[3]] } ], chart: { @@ -202,7 +200,7 @@ export class DashboardComponent implements OnInit { colors: ['transparent'] }, xaxis: { - categories: [...minutesGroup] + categories: [minutesGroup[0], minutesGroup[4], minutesGroup[1], minutesGroup[2], minutesGroup[3]] }, yaxis: { title: {