Add rain days chart
This commit is contained in:
parent
64a8fd6011
commit
88ce05c848
@ -18,6 +18,8 @@ export class GraphComponent implements AfterViewInit {
|
|||||||
colors: string[] = [];
|
colors: string[] = [];
|
||||||
@Input()
|
@Input()
|
||||||
formatSting: string;
|
formatSting: string;
|
||||||
|
@Input()
|
||||||
|
graphType = 'line';
|
||||||
|
|
||||||
readonly randomId = uuidv4();
|
readonly randomId = uuidv4();
|
||||||
|
|
||||||
@ -28,7 +30,7 @@ export class GraphComponent implements AfterViewInit {
|
|||||||
const data: ChartDataSeriesOptions[] = [];
|
const data: ChartDataSeriesOptions[] = [];
|
||||||
for (const monthlyData of this.monthlyDatas) {
|
for (const monthlyData of this.monthlyDatas) {
|
||||||
data.push({
|
data.push({
|
||||||
type: 'line',
|
type: this.graphType,
|
||||||
color: 'black',
|
color: 'black',
|
||||||
showInLegend: this.labels.length > 0,
|
showInLegend: this.labels.length > 0,
|
||||||
yValueFormatString: this.formatSting,
|
yValueFormatString: this.formatSting,
|
||||||
|
|||||||
@ -53,6 +53,16 @@
|
|||||||
</app-graph>
|
</app-graph>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</mat-tab>
|
</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>
|
</mat-tab-group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user