diff --git a/MP.SPEC/Components/Chart/Doughnut.razor.cs b/MP.SPEC/Components/Chart/Doughnut.razor.cs index 49abb269..cf897f44 100644 --- a/MP.SPEC/Components/Chart/Doughnut.razor.cs +++ b/MP.SPEC/Components/Chart/Doughnut.razor.cs @@ -17,8 +17,8 @@ namespace MP.SPEC.Components.Chart Doughnut } - [Parameter] - public string Id { get; set; } + //[Parameter] + public string Id { get; set; } = "myChart"; [Parameter] public ChartType Type { get; set; } @@ -40,15 +40,7 @@ namespace MP.SPEC.Components.Chart Options = new { Responsive = true, - Scales = new - { - YAxes = new[] - { - new { Ticks = new { - BeginAtZero=true - } } - } - } + }, Data = new { diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index f540c4cf..1680b31b 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -86,119 +86,134 @@ else -
} + } diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 5edb4645..3bf6b132 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -182,16 +182,31 @@ namespace MP.SPEC.Components return answ; } - //private string calcolaPerc(double durata) - //{ - // string answ = ""; + private string calcolaPerc(double durata) + { + string answ = ""; - // double tot = 0; + double tot = 0; + if (ListOdlStats != null) + { - // foreach + foreach (var item in ListOdlStats) + { + tot += item.TotDurata; + } - // double perc = (durata/(double)currRecord.DurataMinuti)*100; - //} + double perc = (durata / tot) * 100; + if (perc > 1) + { + answ = perc.ToString("N2"); + } + else + { + answ = perc.ToString("N4"); + } + } + return answ; + } #endregion Private Methods } diff --git a/MP.SPEC/Components/ODLPlot.razor b/MP.SPEC/Components/ODLPlot.razor index 9a5234b8..5e01d0ba 100644 --- a/MP.SPEC/Components/ODLPlot.razor +++ b/MP.SPEC/Components/ODLPlot.razor @@ -1,10 +1,5 @@ @if (@SelectedOdl != -1) { -