diff --git a/src/main/angular/src/app/location/energy/plot/EnergyPoint.ts b/src/main/angular/src/app/location/energy/plot/EnergyPoint.ts index 1e4abd0..4b55f58 100644 --- a/src/main/angular/src/app/location/energy/plot/EnergyPoint.ts +++ b/src/main/angular/src/app/location/energy/plot/EnergyPoint.ts @@ -2,6 +2,8 @@ export class EnergyPoint { readonly epochSeconds: number; + readonly date: Date; + private _purchase: number | null = null; private _produce: number | null = null; @@ -51,6 +53,7 @@ export class EnergyPoint { point: number[], ) { this.epochSeconds = point[0]; + this.date = new Date(this.epochSeconds * 1000); } set deliver(value: number | null) { diff --git a/src/main/angular/src/app/location/energy/plot/energy-plot.html b/src/main/angular/src/app/location/energy/plot/energy-plot.html index ff82c19..6ab888b 100644 --- a/src/main/angular/src/app/location/energy/plot/energy-plot.html +++ b/src/main/angular/src/app/location/energy/plot/energy-plot.html @@ -1,33 +1,42 @@ - + @for (point of points; track point.epochSeconds) { - - - - + + + Bezug: {{ location.energyPurchase?.toValue(point.purchase, point.date)?.toValueString(null) }} + Solar: {{ location.energyProduce?.toValue(point.produce, point.date)?.toValueString(null) }} + Selbst: {{ location.energyPurchase?.toValue(point.self, point.date)?.toValueString(null) }} + Einsp.: {{ location.energyDeliver?.toValue(point.deliver, point.date)?.toValueString(null) }} + Verbrauch: {{ location.energyPurchase?.toValue(point.consume, point.date)?.toValueString(null) }} + + + + + } + diff --git a/src/main/angular/src/app/location/energy/plot/energy-plot.less b/src/main/angular/src/app/location/energy/plot/energy-plot.less index de6aeea..788f7a8 100644 --- a/src/main/angular/src/app/location/energy/plot/energy-plot.less +++ b/src/main/angular/src/app/location/energy/plot/energy-plot.less @@ -1 +1,5 @@ @import "../../../../colors"; + +g:hover { + stroke: black; +} diff --git a/src/main/angular/src/app/location/energy/plot/energy-plot.ts b/src/main/angular/src/app/location/energy/plot/energy-plot.ts index 02b494e..b2eeb23 100644 --- a/src/main/angular/src/app/location/energy/plot/energy-plot.ts +++ b/src/main/angular/src/app/location/energy/plot/energy-plot.ts @@ -126,6 +126,10 @@ export class EnergyPlot implements OnInit, OnDestroy, AfterViewInit { this.ngAfterViewInit(); } + get location(): Location { + return this._location; + } + @Input() set interval(value: Interval) { this._interval = value; diff --git a/src/main/angular/src/app/series/Series.ts b/src/main/angular/src/app/series/Series.ts index a77a00a..ba63a0c 100644 --- a/src/main/angular/src/app/series/Series.ts +++ b/src/main/angular/src/app/series/Series.ts @@ -37,4 +37,11 @@ export class Series { return this.id === other?.id; } + toValue(value: number | null | undefined, date: Date | null | undefined): Value { + if (value === null || value === undefined || date === null || date === undefined) { + return Value.NULL; + } + return Value.of(this, value, date); + } + }