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) { -
-
- @SelectedOdl -
-
@if (isLoading) @@ -13,7 +8,7 @@ } else { - + }
diff --git a/MP.SPEC/Components/ODLPlot.razor.cs b/MP.SPEC/Components/ODLPlot.razor.cs index e62b9dd2..b4a33260 100644 --- a/MP.SPEC/Components/ODLPlot.razor.cs +++ b/MP.SPEC/Components/ODLPlot.razor.cs @@ -49,14 +49,19 @@ namespace MP.SPEC.Components public List Data = new List(); public List Labels = new List(); + public List colors = new List(); protected async Task ReloadData() { + Data.Clear(); + Labels.Clear(); + colors.Clear(); ListRecords = await MDService.StatOdl(SelectedOdl); foreach (var record in ListRecords) { Data.Add(record.TotDurata); Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min"); + colors.Add(record.Css); } await Task.Delay(1); isLoading = false; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 5987cfad..d55fb8a2 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1309 + 6.16.2210.1411 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 90867b8e..6053acb5 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1309

+

Versione: 6.16.2210.1411


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 532c5790..baa7c949 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1309 +6.16.2210.1411 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index a76b4680..a0e756a0 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1309 + 6.16.2210.1411 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false diff --git a/MP.SPEC/wwwroot/lib/chartBoot.js b/MP.SPEC/wwwroot/lib/chartBoot.js index 95c7466d..50401512 100644 --- a/MP.SPEC/wwwroot/lib/chartBoot.js +++ b/MP.SPEC/wwwroot/lib/chartBoot.js @@ -4,13 +4,17 @@ window.setup = (id, config) => { //let currentDate = new Date(); //console.log(currentDate + " - Calling setup..."); console.log(id); - if (window['chart-' + id] instanceof Chart) { + if (window['myChart'] instanceof Chart) { //window.myChart.destroy(); - window['chart-' + id].destroy(); - //console.log("Chart " + id + " destroyed!"); + window['myChart'].destroy(); + console.log("Chart " + id + " destroyed!"); + window['myChart'] = new Chart(ctx, config); + } + else + { + window['myChart'] = new Chart(ctx, config); + //console.log("Chart " + id + " created!"); + console.log(window['myChart']); } - window['chart-' + id] = new Chart(ctx, config); - //console.log("Chart " + id + " created!"); - console.log(window['chart-' + id]); } \ No newline at end of file