Files
2023-01-30 19:39:20 +01:00

55 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using SHERPA.AD;
using SHERPA.AD.Components;
using SHERPA.AD.Shared;
using SHERPA.Data;
using SHERPA.Data.DbModels;
namespace SHERPA.AD.Components
{
public partial class BarPlot
{
[Parameter]
public List<DataItem> ListaValori { get; set; } = new List<DataItem>();
public class DataItem
{
//public DataItem(string _label, double _value, double _maxValue, string _css, string _tooltip)
//{
// Label = _label;
// Value = _value;
// MaxValue = _maxValue;
// Css = _css;
// Tooltip = _tooltip;
//}
public string Label { get; set; } = "";
public double Value { get; set; } = 0;
public double MaxValue { get; set; } = 1;
public string Css { get; set; } = "";
public string Tooltip { get; set; } = "";
public double RatioValue
{
get => Value / (MaxValue != 0 ? MaxValue : 1);
}
public string RatioWidth
{
get => $"{RatioValue:P0}";
}
}
}
}