70 lines
1.7 KiB
Plaintext
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}") → @($"{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);
|
|
}
|
|
|
|
}
|