Add "Strom" page for the yearly NeoVac electricity bills #9

Merged
clayschaad merged 6 commits from add-electricity-page into main 2026-10-27 18:40:53 +00:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 034bc4e0f0 - Show all commits

View file

@ -53,5 +53,11 @@
AriaLabel="Preis pro kWh für Netz, PV und Total über die Abrechnungsperioden" />
</FluentCard>
</div>
<FluentCard class="chart-card">
<div class="card-title">Gesamtkosten pro Periode</div>
<ChartJsChart Kind="line" Data="@costData" Height="320px"
AriaLabel="Gesamtkosten pro Abrechnungsperiode" />
</FluentCard>
}
</div>

View file

@ -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()