factor to calculate W from kWh
This commit is contained in:
parent
5c2f9423d3
commit
a94d80753a
@ -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" [maxY]="0.07" [minY]="-0.07">
|
<app-location-energy [location]="location" [interval]="Interval.DAY" [offset]="offsetDay" unit="⌀W" [factor]="12 * 1000" [maxY]="850" [minY]="-850">
|
||||||
<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()
|
||||||
|
unit: string = "";
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
factor: number = 1;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
maxY: number | undefined = undefined;
|
maxY: number | undefined = undefined;
|
||||||
|
|
||||||
@ -99,9 +105,9 @@ class EnergyCharts {
|
|||||||
categoryPercentage: 1.0,
|
categoryPercentage: 1.0,
|
||||||
barPercentage: 0.95,
|
barPercentage: 0.95,
|
||||||
data: pointSeries.points.map(p => {
|
data: pointSeries.points.map(p => {
|
||||||
return {x: p[0] * 1000, y: p[1] * factor};
|
return {x: p[0] * 1000, y: p[1] * factor * this.factor};
|
||||||
}),
|
}),
|
||||||
label: `${pointSeries.series.name} [${pointSeries.series.unit}]`,
|
label: `${pointSeries.series.name} [${this.unit || pointSeries.series.unit}]`,
|
||||||
borderColor: color,
|
borderColor: color,
|
||||||
backgroundColor: color,
|
backgroundColor: color,
|
||||||
stack: stack ? stack : undefined,
|
stack: stack ? stack : undefined,
|
||||||
|
|||||||
@ -86,6 +86,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-energy-charts [location]="location" [interval]="interval" [offset]="offset" [maxY]="maxY" [minY]="minY"></app-energy-charts>
|
<app-energy-charts [location]="location" [interval]="interval" [offset]="offset" [unit]="unit" [factor]="factor" [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()
|
||||||
|
unit: string = "";
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
factor: number = 1;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
maxY: number | undefined = undefined;
|
maxY: number | undefined = undefined;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user