add routerLink to mat-table to later route to given Station

* adjust color to match bootstrap blue
This commit is contained in:
Tim Herbst 2020-12-27 11:31:03 +01:00
parent 13f06a0ce5
commit f1f82b9dd1
3 changed files with 16 additions and 11 deletions

View File

@ -71,7 +71,8 @@
<table [dataSource]="stationToSource" class="mat-elevation-z8" fxFill mat-table> <table [dataSource]="stationToSource" class="mat-elevation-z8" fxFill mat-table>
<ng-container matColumnDef="endStationName"> <ng-container matColumnDef="endStationName">
<th *matHeaderCellDef mat-header-cell> station of lend destination</th> <th *matHeaderCellDef mat-header-cell> station of lend destination</th>
<td *matCellDef="let element" mat-cell> {{element.endStationName}} </td> <td *matCellDef="let element" mat-cell><a
[routerLink]="['dashboard/', element.id]">{{element.endStationName}}</a></td>
</ng-container> </ng-container>
<ng-container matColumnDef="number"> <ng-container matColumnDef="number">
@ -92,7 +93,8 @@
<table [dataSource]="stationFromSource" class="mat-elevation-z9" fxFill mat-table> <table [dataSource]="stationFromSource" class="mat-elevation-z9" fxFill mat-table>
<ng-container matColumnDef="startStationName"> <ng-container matColumnDef="startStationName">
<th *matHeaderCellDef mat-header-cell> station of lend origin</th> <th *matHeaderCellDef mat-header-cell> station of lend origin</th>
<td *matCellDef="let element" mat-cell> {{element.startStationName}} </td> <td *matCellDef="let element" mat-cell><a
[routerLink]="['dashboard/', element.id]"> {{element.startStationName}}</a></td>
</ng-container> </ng-container>
<ng-container matColumnDef="number"> <ng-container matColumnDef="number">
@ -121,6 +123,7 @@
<div class="station-dashboard-borrow-duration" fxFlex="97%"> <div class="station-dashboard-borrow-duration" fxFlex="97%">
<apx-chart <apx-chart
[chart]="durationChartOptions.chart" [chart]="durationChartOptions.chart"
[colors]="durationChartOptions.colors"
[dataLabels]="durationChartOptions.dataLabels" [dataLabels]="durationChartOptions.dataLabels"
[fill]="durationChartOptions.fill" [fill]="durationChartOptions.fill"
[legend]="durationChartOptions.legend" [legend]="durationChartOptions.legend"
@ -144,6 +147,7 @@
<div class="station-dashboard-borrow-time" fxFlex> <div class="station-dashboard-borrow-time" fxFlex>
<apx-chart <apx-chart
[chart]="timeChartOptions.chart" [chart]="timeChartOptions.chart"
[colors]="timeChartOptions.colors"
[dataLabels]="timeChartOptions.dataLabels" [dataLabels]="timeChartOptions.dataLabels"
[fill]="timeChartOptions.fill" [fill]="timeChartOptions.fill"
[series]="timeChartOptions.series" [series]="timeChartOptions.series"

View File

@ -6,6 +6,10 @@ mat-sidenav-content {
flex: 1 1 auto; flex: 1 1 auto;
} }
a {
color: #017bfe;
}
.button-back:hover, .button-wiki:hover { .button-back:hover, .button-wiki:hover {
background: #5a34a0; background: #5a34a0;
} }

View File

@ -27,6 +27,7 @@ export type ChartOptions = {
title: ApexTitleSubtitle title: ApexTitleSubtitle
series: ApexAxisChartSeries; series: ApexAxisChartSeries;
chart: ApexChart; chart: ApexChart;
colors: string[];
dataLabels: ApexDataLabels; dataLabels: ApexDataLabels;
plotOptions: ApexPlotOptions; plotOptions: ApexPlotOptions;
yaxis: ApexYAxis | ApexYAxis[]; yaxis: ApexYAxis | ApexYAxis[];
@ -38,7 +39,7 @@ export type ChartOptions = {
noData: ApexNoData; noData: ApexNoData;
}; };
const chartHeight = 450; const chartHeight = 460;
@Component({ @Component({
selector: 'app-dashboard', selector: 'app-dashboard',
@ -76,9 +77,6 @@ export class DashboardComponent implements OnInit {
chart: { chart: {
type: 'bar' type: 'bar'
}, },
dataLabels: {
enabled: false
},
noData: { noData: {
text: 'Loading...' text: 'Loading...'
} }
@ -86,10 +84,7 @@ export class DashboardComponent implements OnInit {
this.timeChartOptions = { this.timeChartOptions = {
series: [], series: [],
chart: { chart: {
type: 'bar' type: 'line'
},
dataLabels: {
enabled: false
}, },
noData: { noData: {
text: 'Loading...' text: 'Loading...'
@ -282,6 +277,7 @@ export class DashboardComponent implements OnInit {
type: 'bar', type: 'bar',
height: chartHeight height: chartHeight
}, },
colors: ['#017bfe'],
plotOptions: { plotOptions: {
bar: { bar: {
horizontal: false, horizontal: false,
@ -349,6 +345,7 @@ export class DashboardComponent implements OnInit {
enabled: true enabled: true
} }
}, },
colors: ['#017bfe', '#51ca49'],
dataLabels: { dataLabels: {
enabled: false enabled: false
}, },