Add "Strom" page for the yearly NeoVac electricity bills #9
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" />
|
AriaLabel="Preis pro kWh für Netz, PV und Total über die Abrechnungsperioden" />
|
||||||
</FluentCard>
|
</FluentCard>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ public partial class Electricity : ComponentBase
|
||||||
|
|
||||||
private object barData = new();
|
private object barData = new();
|
||||||
private object lineData = new();
|
private object lineData = new();
|
||||||
|
private object costData = new();
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
|
@ -70,6 +71,15 @@ public partial class Electricity : ComponentBase
|
||||||
unit = "CHF/kWh",
|
unit = "CHF/kWh",
|
||||||
axisDecimals = 2
|
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()
|
private async Task AddAsync()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue