charts: minY/maxY
This commit is contained in:
parent
d1c42aa6aa
commit
5c2f9423d3
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<app-location-power [location]="location"></app-location-power>
|
<app-location-power [location]="location"></app-location-power>
|
||||||
|
|
||||||
<app-location-energy [location]="location" [interval]="Interval.DAY" [offset]="offsetDay">
|
<app-location-energy [location]="location" [interval]="Interval.DAY" [offset]="offsetDay" [maxY]="0.07" [minY]="-0.07">
|
||||||
<ng-content #SeriesHistoryHeading>
|
<ng-content #SeriesHistoryHeading>
|
||||||
<div style="display: flex; width: 100%">
|
<div style="display: flex; width: 100%">
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,12 @@ const COLOR_BACK_CONSUME = "#ffc07a";
|
|||||||
})
|
})
|
||||||
class EnergyCharts {
|
class EnergyCharts {
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
maxY: number | undefined = undefined;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
minY: number | undefined = undefined;
|
||||||
|
|
||||||
private _offset!: number | null;
|
private _offset!: number | null;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
@ -114,7 +120,7 @@ class EnergyCharts {
|
|||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
animation: false,
|
animation: false,
|
||||||
scales: {
|
scales: {
|
||||||
'x': {
|
x: {
|
||||||
type: 'time',
|
type: 'time',
|
||||||
min: result.begin.getTime(),
|
min: result.begin.getTime(),
|
||||||
max: result.end.getTime() - (this._interval?.inner?.millis || 0),
|
max: result.end.getTime() - (this._interval?.inner?.millis || 0),
|
||||||
@ -133,8 +139,8 @@ class EnergyCharts {
|
|||||||
bounds: 'ticks',
|
bounds: 'ticks',
|
||||||
},
|
},
|
||||||
y: {
|
y: {
|
||||||
suggestedMax: 0.5,
|
max: this.maxY,
|
||||||
suggestedMin: -0.1,
|
min: this.minY,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -86,6 +86,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-energy-charts [location]="location" [interval]="interval" [offset]="offset"></app-energy-charts>
|
<app-energy-charts [location]="location" [interval]="interval" [offset]="offset" [maxY]="maxY" [minY]="minY"></app-energy-charts>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -62,6 +62,12 @@ export class LocationEnergy implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
return this._o_;
|
return this._o_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
maxY: number | undefined = undefined;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
minY: number | undefined = undefined;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
interval!: Interval;
|
interval!: Interval;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user