COmpletato display x integrazione dichiarazioni operatore

This commit is contained in:
Samuele Locatelli
2022-02-26 18:16:21 +01:00
parent efa11f9452
commit 2e2639b94f
17 changed files with 197 additions and 316 deletions
+57 -131
View File
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components;
using MP.Data;
using MP.Stats.Data;
using System.Collections.Generic;
using System.Linq;
namespace MP.Stats.Components
{
@@ -16,88 +14,68 @@ namespace MP.Stats.Components
protected const string EsitoOK = "Esito: OK";
protected object lineChartOptions = new
{
Scales = new
{
XAxes = new object[]
{
new {
Display = true
}
},
YAxes = new object[]
{
new {
Display = true,
ticks= new {
suggestedMin = 0
}
}
}
},
Tooltips = new
{
Mode = "nearest",
Intersect = false
},
Hover = new
{
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 4.9
};
protected object pieChartOptions = new
{
Scales = new
{
XAxes = new object[]
{
new {
Display = false
}
},
YAxes = new object[]
{
new {
Display = false
}
}
},
Legend = new
{
Display = false
},
Tooltips = new
{
Mode = "nearest",
Intersect = false
},
Hover = new
{
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 1
};
#if false
protected PieChart<double> PieVC = new PieChart<double>();
protected LineChart<double> TimeSerieVC = new LineChart<double>();
#endif
#endregion Protected Fields
#region Private Properties
private List<double> DatiPareto
{
get => ParetoData.Select(x => x.value).ToList();
}
private List<chartJsData.chartJsTSerie> DatiPlot
{
get => TSData;
}
private List<string> LabelPareto
{
get => ParetoData.Select(x => x.label).ToList();
}
private List<string> LabelPlot
{
get => TSData.Select(r => $"{r.x:yyyy-MM-dd}").ToList();
}
#endregion Private Properties
#region Protected Properties
protected SelectData _currFilter { get; set; } = new SelectData();
protected List<MP.Data.DatabaseModels.UserActionLog> _rawData { get; set; } = new List<MP.Data.DatabaseModels.UserActionLog>();
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> bgColors
{
get => semaphColors(ParetoData.Count, "0.3");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColor
{
get => solidColors("1");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColors
{
get => semaphColors(ParetoData.Count, "1");
}
[Inject]
protected MessageService MessageService { get; set; }
@@ -132,7 +110,6 @@ namespace MP.Stats.Components
#region Private Methods
private List<string> GetLineChartLabels()
{
var answ = TSData.Select(x => x.x.ToString("ddd dd.MM")).ToList();
@@ -161,7 +138,6 @@ namespace MP.Stats.Components
#region Protected Methods
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
@@ -199,56 +175,6 @@ namespace MP.Stats.Components
return answ;
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> bgColors
{
get => semaphColors(ParetoData.Count, "0.3");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColor
{
get => solidColors("1");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColors
{
get => semaphColors(ParetoData.Count, "1");
}
private List<double> DatiPareto
{
get => ParetoData.Select(x => x.value).ToList();
}
private List<chartJsData.chartJsTSerie> DatiPlot
{
get => TSData;
}
private List<string> LabelPareto
{
get => ParetoData.Select(x => x.label).ToList();
}
private List<string> LabelPlot
{
get => TSData.Select(r => $"{r.x:yyyy-MM-dd}").ToList();
}
#endregion Protected Methods
}
}