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 <noreply@anthropic.com>
This commit is contained in:
parent
ec0bf7d602
commit
034bc4e0f0
2 changed files with 16 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue