From fa4480836f292869e46404abc66ade84d2d1aa43 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 13 Jan 2025 18:04:39 +0100 Subject: [PATCH] Update visualizzazione Doughnut: aggiunto spessore bordo --- .../Pages/TestChart.razor.cs | 6 ++-- EgwCoreLib.Razor/Doughnut.razor | 9 +++++- EgwCoreLib.Utils/EgwCoreLib.Utils.csproj | 1 + EgwCoreLib.Utils/MachineDataValidator.cs | 29 +++++++++++++++++-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs b/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs index 9a26370..7897992 100644 --- a/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs +++ b/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs @@ -101,15 +101,15 @@ namespace EgwCoreLib.BlazorTest.Pages answ.Add(currColor); if (currColor > 7) { - colors.Add(new DoughnutStyling("#28FF69", "ccc")); + colors.Add(new DoughnutStyling("#28FF69", "#00AA00")); } else if (currColor > 3) { - colors.Add(new DoughnutStyling("orange", "ccc")); + colors.Add(new DoughnutStyling("orange", "#99AA00")); } else { - colors.Add(new DoughnutStyling("red", "ccc")); + colors.Add(new DoughnutStyling("red", "#FF6969")); } } return answ.ToArray(); diff --git a/EgwCoreLib.Razor/Doughnut.razor b/EgwCoreLib.Razor/Doughnut.razor index ce566e4..dd282be 100644 --- a/EgwCoreLib.Razor/Doughnut.razor +++ b/EgwCoreLib.Razor/Doughnut.razor @@ -59,7 +59,14 @@ { Datasets = new[] { - new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 1, borderRadius = 0 } + new { + Data = Data, + BackgroundColor = BackgroundColor.Select(x=>x.color), + BorderColor = BackgroundColor.Select(x=>x.border), + BorderWidth = 1, + offset= 1, + borderRadius = 0 + } }, Labels = Labels }, diff --git a/EgwCoreLib.Utils/EgwCoreLib.Utils.csproj b/EgwCoreLib.Utils/EgwCoreLib.Utils.csproj index ad2e315..74f5a8e 100644 --- a/EgwCoreLib.Utils/EgwCoreLib.Utils.csproj +++ b/EgwCoreLib.Utils/EgwCoreLib.Utils.csproj @@ -19,6 +19,7 @@ + diff --git a/EgwCoreLib.Utils/MachineDataValidator.cs b/EgwCoreLib.Utils/MachineDataValidator.cs index 7bad3b1..e5da65e 100644 --- a/EgwCoreLib.Utils/MachineDataValidator.cs +++ b/EgwCoreLib.Utils/MachineDataValidator.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; @@ -45,10 +46,34 @@ namespace EgwCoreLib.Utils } } + /// + /// Init classe validatore + /// + /// + public MachineDataValidator(string rawData) + { + // inizializzo info di base + Dictionary currMachineData = new Dictionary(); + if (!string.IsNullOrEmpty(rawData)) + { + try + { + currMachineData = JsonConvert.DeserializeObject>(rawData); + } + catch (Exception exc) + { } + } + } + #endregion Public Constructors #region Public Properties + public bool hasValidData + { + get => machTestData != null && machTestData.Count > 0; + } + /// /// Restituisce HASH del codice impiego = payload utente /// @@ -216,4 +241,4 @@ namespace EgwCoreLib.Utils #endregion Private Methods } -} +} \ No newline at end of file