Files
egwcorelib/EgwCoreLib.BlazorTest/Pages/TestCompo.razor
T
zaccaria.majid 941e20258e last comm
2023-06-29 16:37:48 +02:00

70 lines
1.7 KiB
Plaintext

@page "/TestCompo"
@using EgwCoreLib.Razor.Data;
@using EgwCoreLib.Utils;
<PageTitle>Test</PageTitle>
<h3>TestCompo</h3>
@*<div class="row">
<div class="col-6">
@if (periodo != null)
{
<div>
Periodo Selezionato: <b>@($"{periodo.Inizio:yyyy/MM/dd}") &rarr; @($"{periodo.Fine:yyyy/MM/dd}")</b>
</div>
}
</div>
<div class="col-6">
<PeriodoSel E_PeriodoSel="setPeriodo" CurrPeriodo="@periodo"></PeriodoSel>
</div>
</div>*@
<Doughnut Type="@Doughnut.ChartType.Doughnut" Data="@Data.ToArray()" BackgroundColor="@colors"></Doughnut>
@code {
#if false
protected DtUtils.Periodo? periodo { get; set; } = new DtUtils.Periodo(DtUtils.PeriodSet.ThisTrim);
protected async Task setPeriodo(DtUtils.Periodo newPeriodo)
{
await Task.Delay(1);
periodo = newPeriodo;
}
#endif
public List<DoughnutStyling> colors = new List<DoughnutStyling>();
public List<double> Data = new List<double>();
public List<string> Labels = new List<string>();
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
}
protected override async Task OnParametersSetAsync()
{
await ReloadData();
await Task.Delay(1);
}
protected async Task ReloadData()
{
Data.Clear();
Labels.Clear();
colors.Clear();
for (int x = 0; x < 5; x++)
{
Data.Add(x);
Labels.Add($"test n#: {x} - {x}min");
colors.Add(new DoughnutStyling("orange", "ccc"));
colors.Add(new DoughnutStyling("#2874A6", "ccc"));
}
await Task.Delay(1);
}
}