diff --git a/MP.IOC/Components/ChartJS/BarPlot.razor b/MP.IOC/Components/ChartJS/BarPlot.razor index 985a7630..1b2916d2 100644 --- a/MP.IOC/Components/ChartJS/BarPlot.razor +++ b/MP.IOC/Components/ChartJS/BarPlot.razor @@ -54,7 +54,7 @@ responsive = true, scales = new { - yAxes = new + y = new { suggestedMin = 0, display = true, @@ -82,7 +82,7 @@ labels = Labels } }; - // creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js, tipo verticale + // creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js, tipo orizzontale var configHor = new { type = "bar", diff --git a/MP.IOC/Components/ChartJS/PieChart.razor b/MP.IOC/Components/ChartJS/PieChart.razor index 5294db68..8fd4f0f7 100644 --- a/MP.IOC/Components/ChartJS/PieChart.razor +++ b/MP.IOC/Components/ChartJS/PieChart.razor @@ -7,10 +7,10 @@ [Parameter] public string Id { get; set; } = "MyTs"; - + [Parameter] public string Title { get; set; } = "DEMO Pie Chart"; - + [Parameter] public string LegendPos { get; set; } = "right"; @@ -25,7 +25,7 @@ [Parameter] public List backColor { get; set; } = new List(); - + [Parameter] public double AspRatio { get; set; } = 0; @@ -55,29 +55,28 @@ /// protected async Task renderChart() { + var showLegend = Labels.Count <= 15; + var options = new Dictionary + { + ["responsive"] = true, + ["animation"] = false, + ["plugins"] = new + { + legend = new { display = showLegend, position = LegendPos }, + title = new { display = true, text = Title } + } + }; + + if (AspRatio != 0) + { + options["aspectRatio"] = AspRatio; + } + // creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js var config = new { type = "pie", - options = new - { - responsive = true, - plugins = new - { - legend = new - { - position = LegendPos - }, - title = new - { - display = true, - text = Title - } - }, - Animation = false, - AspectRatio = AspRatio == 0 ? "auto" : $"{AspRatio}", - HoverBorderWidth = 3 - }, + options, data = new { labels = Labels.ToArray(), @@ -86,8 +85,9 @@ new { data = Data, - borderColor= lineColor, - backgroundColor= backColor + borderColor = lineColor, + backgroundColor = backColor, + hoverBorderWidth = 3 } } } diff --git a/MP.IOC/Components/Pages/CallStats.razor.cs b/MP.IOC/Components/Pages/CallStats.razor.cs index a1047464..8aee3984 100644 --- a/MP.IOC/Components/Pages/CallStats.razor.cs +++ b/MP.IOC/Components/Pages/CallStats.razor.cs @@ -66,12 +66,14 @@ namespace MP.IOC.Components.Pages private List DatiPareto { - get => currData.OrderByDescending(x => x.Value).Take(ParetoTake).Select(x => x.Value).ToList(); + get => currData.OrderByDescending(x => x.Value).Select(x => x.Value).ToList(); + //get => currData.OrderByDescending(x => x.Value).Take(5).Select(x => x.Value).ToList(); } private List LabelPareto { - get => currData.OrderByDescending(x => x.Value).Take(ParetoTake).Select(x => x.Label).ToList(); + get => currData.OrderByDescending(x => x.Value).Select(x => x.Label).ToList(); + //get => currData.OrderByDescending(x => x.Value).Take(5).Select(x => x.Label).ToList(); } private List LabelPlot @@ -93,11 +95,6 @@ namespace MP.IOC.Components.Pages get => GetDistinctColors(tsDataDetail.Count, "1"); } - private int ParetoTake - { - get => currData.Count() <= 25 ? currData.Count() : 25; - } - [Inject] private IStatsDetailService SDetService { get; set; } = null!; diff --git a/MP.IOC/MP.IOC.csproj b/MP.IOC/MP.IOC.csproj index 01c61f91..01f8e2f1 100644 --- a/MP.IOC/MP.IOC.csproj +++ b/MP.IOC/MP.IOC.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 6.16.2604.2109 + 6.16.2604.2111 diff --git a/MP.IOC/Resources/ChangeLog.html b/MP.IOC/Resources/ChangeLog.html index cd32f934..e38800ea 100644 --- a/MP.IOC/Resources/ChangeLog.html +++ b/MP.IOC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MP-IOC -

Versione: 6.16.2604.2109

+

Versione: 6.16.2604.2111


Note di rilascio:
  • diff --git a/MP.IOC/Resources/VersNum.txt b/MP.IOC/Resources/VersNum.txt index b11ffbeb..5c00dd54 100644 --- a/MP.IOC/Resources/VersNum.txt +++ b/MP.IOC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2604.2109 +6.16.2604.2111 diff --git a/MP.IOC/Resources/manifest.xml b/MP.IOC/Resources/manifest.xml index ea027340..aed9404f 100644 --- a/MP.IOC/Resources/manifest.xml +++ b/MP.IOC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2604.2109 + 6.16.2604.2111 https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html false