From 38cbf40ad2bc23bfe1843d8d0ebb69a059d4149c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 15 Jan 2025 12:49:39 +0100 Subject: [PATCH] Fix display pareto: usa conteggio se non usate licenze --- LiMan.UI/Components/InstAppPareto.razor.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/LiMan.UI/Components/InstAppPareto.razor.cs b/LiMan.UI/Components/InstAppPareto.razor.cs index a1ffc57..6d4db72 100644 --- a/LiMan.UI/Components/InstAppPareto.razor.cs +++ b/LiMan.UI/Components/InstAppPareto.razor.cs @@ -27,11 +27,22 @@ namespace LiMan.UI.Components protected override void OnParametersSet() { ListRecord = CurrRecord.DetailInstalled.OrderByDescending(x => x.VersNumInstall).ToList(); - // sistemo info x grafico... + // sistemo info x grafico... se ho impieghi uso quello, altrimenti istanze... + if(CurrRecord.NumImp>0) + { ChartData = ListRecord .GroupBy(x => x.VersNumInstall) .Select(g => (double)g.Sum(x => x.NumImp)) .ToArray(); + } + else + { + ChartData = ListRecord + .GroupBy(x => x.VersNumInstall) + .Select(g => (double)g.Count()) + .ToArray(); + } + ChartLabels = ListRecord .GroupBy(x => x.VersNumInstall) .Select(g => g.Key)