From 034bc4e0f02d524729e012dd07fbd2e68c50d018 Mon Sep 17 00:00:00 2001 From: Claudio Schaad Date: Mon, 26 Oct 2026 16:29:32 +0100 Subject: [PATCH] Add a total-costs-per-period line chart to the Strom page A third chart below the existing pair, plotting ElectricityBill.TotalChf per period. Co-Authored-By: Claude Sonnet 5 --- .../Components/Pages/Electricity.razor | 6 ++++++ .../Components/Pages/Electricity.razor.cs | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/Schaad.Accounting.UI/Components/Pages/Electricity.razor b/Schaad.Accounting.UI/Components/Pages/Electricity.razor index d8cfcf7..47fa361 100644 --- a/Schaad.Accounting.UI/Components/Pages/Electricity.razor +++ b/Schaad.Accounting.UI/Components/Pages/Electricity.razor @@ -53,5 +53,11 @@ AriaLabel="Preis pro kWh für Netz, PV und Total über die Abrechnungsperioden" /> + + +
Gesamtkosten pro Periode
+ +
} diff --git a/Schaad.Accounting.UI/Components/Pages/Electricity.razor.cs b/Schaad.Accounting.UI/Components/Pages/Electricity.razor.cs index f5d799c..0fe2531 100644 --- a/Schaad.Accounting.UI/Components/Pages/Electricity.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/Electricity.razor.cs @@ -31,6 +31,7 @@ public partial class Electricity : ComponentBase private object barData = new(); private object lineData = new(); + private object costData = new(); protected override async Task OnInitializedAsync() { @@ -70,6 +71,15 @@ public partial class Electricity : ComponentBase unit = "CHF/kWh", axisDecimals = 2 }; + costData = new + { + labels, + series = new object[] + { + new { name = "Total", color = ChartTheme.ColorAt(2), values = source.Select(b => (decimal?)b.TotalChf).ToList(), width = 2 } + }, + unit = "CHF" + }; } private async Task AddAsync()