diff --git a/MP.Stats/Pages/Test.razor b/MP.Stats/Pages/Test.razor
index 7877bfbe..181bc912 100644
--- a/MP.Stats/Pages/Test.razor
+++ b/MP.Stats/Pages/Test.razor
@@ -12,15 +12,15 @@
-
+
-
+
-
+
@@ -44,13 +44,13 @@
*@
-
+
-
+
diff --git a/MP.Stats/Pages/Test.razor.cs b/MP.Stats/Pages/Test.razor.cs
index f625f32d..babb3977 100644
--- a/MP.Stats/Pages/Test.razor.cs
+++ b/MP.Stats/Pages/Test.razor.cs
@@ -24,7 +24,9 @@ namespace MP.Stats.Pages
public int numRec
{
- get { return _numRec;
+ get
+ {
+ return _numRec;
}
set
{
@@ -148,6 +150,20 @@ namespace MP.Stats.Pages
histData = histDict.Values.ToArray();
histLabel = histDict.Keys.Select(x => $"{x}").ToArray();
+ // calcolo i valori raggruppati in numGroup...
+ int numGroup = (int)Math.Sqrt(numRec);
+ double minVal = rawData.Min();
+ double maxVal = rawData.Max();
+ double step = (maxVal - minVal) / numGroup;
+ var histDictGroup = rawData.GroupBy(r => ((int)Math.Round((r - minVal) / step)) * step + minVal).Select(g => new
+ {
+ g.Key,
+ Count = g.Count()
+ }).OrderBy(d => d.Key).ToDictionary(x => x.Key, x => x.Count.ToString());
+ histGroupData = histDictGroup.Values.ToArray();
+ histGroupLabel = histDictGroup.Keys.Select(x => $"{x:N2}").ToArray();
+
+
dataList = TSData(DateTime.Today.AddHours(-rawData.Count), rawData).Select(r => new chartJsData.chartJsTSerie()
{ x = r.Key, y = r.Value }).ToList();
@@ -156,6 +172,10 @@ namespace MP.Stats.Pages
protected string[]? histData { get; set; } = null;
protected string[]? histLabel { get; set; } = null;
+
+ protected string[]? histGroupData { get; set; } = null;
+
+ protected string[]? histGroupLabel { get; set; } = null;
protected List? dataList { get; set; } = null;
#if false
@@ -186,12 +206,12 @@ namespace MP.Stats.Pages
List borderColors = new List { ChartColor.FromRgba(255, 99, 132, 1f), ChartColor.FromRgba(54, 162, 235, 1f), ChartColor.FromRgba(255, 206, 86, 1f), ChartColor.FromRgba(75, 192, 192, 1f), ChartColor.FromRgba(153, 102, 255, 1f), ChartColor.FromRgba(255, 159, 64, 1f) };
#endif
- private List RandomizeData()
+ private List RandomizeData()
{
var r = new Random(DateTime.Now.Millisecond);
- List answ = new List();
+ List answ = new List();
for (int i = 0; i < numRec; i++)
{
double u1 = 1.0 - r.NextDouble(); // uniform (0,1] random doubles
@@ -199,14 +219,14 @@ namespace MP.Stats.Pages
double randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2);
double randNormal = mean + stdDev * randStdNormal; // random normal (mean, stdDev^2)
//answ.Add(r.Next(3, 30) * r.NextDouble());
- answ.Add((int)(randNormal * 10));
+ answ.Add(randNormal);
}
return answ;
}
- private Dictionary TSData(DateTime inizio, List yData)
+ private Dictionary TSData(DateTime inizio, List yData)
{
- Dictionary answ = new Dictionary();
+ Dictionary answ = new Dictionary();
// usando i dati ricevuti aggiunge variabile x = tempo crescente
int idx = 0;
foreach (var item in yData)
diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html
index 44898f68..00e3c255 100644
--- a/MP.Stats/Resources/ChangeLog.html
+++ b/MP.Stats/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo statistiche MAPO
- Versione: 6.14.2202.2412
+ Versione: 6.14.2202.2511
Note di rilascio:
diff --git a/MP.Stats/Resources/VersNum.txt b/MP.Stats/Resources/VersNum.txt
index 7b2142ac..47a106c9 100644
--- a/MP.Stats/Resources/VersNum.txt
+++ b/MP.Stats/Resources/VersNum.txt
@@ -1 +1 @@
-6.14.2202.2412
+6.14.2202.2511
diff --git a/MP.Stats/Resources/manifest.xml b/MP.Stats/Resources/manifest.xml
index af8a27b4..94cd6606 100644
--- a/MP.Stats/Resources/manifest.xml
+++ b/MP.Stats/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.14.2202.2412
+ 6.14.2202.2511
https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip
https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html
false