Add rain days chart

This commit is contained in:
Patrick Gebhardt 2020-06-23 11:43:05 +02:00
parent 64a8fd6011
commit 88ce05c848
2 changed files with 13 additions and 1 deletions

View File

@ -18,6 +18,8 @@ export class GraphComponent implements AfterViewInit {
colors: string[] = [];
@Input()
formatSting: string;
@Input()
graphType = 'line';
readonly randomId = uuidv4();
@ -28,7 +30,7 @@ export class GraphComponent implements AfterViewInit {
const data: ChartDataSeriesOptions[] = [];
for (const monthlyData of this.monthlyDatas) {
data.push({
type: 'line',
type: this.graphType,
color: 'black',
showInLegend: this.labels.length > 0,
yValueFormatString: this.formatSting,

View File

@ -53,6 +53,16 @@
</app-graph>
</ng-template>
</mat-tab>
<mat-tab *ngIf="region.rain_days && region.rain_days[0]" label="Rain days">
<ng-template matTabContent>
<app-graph
[monthlyDatas]="[region.rain_days]"
class="graph"
formatSting="####"
graphType="column">
</app-graph>
</ng-template>
</mat-tab>
</mat-tab-group>
</div>
</div>