using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; namespace EgwCoreLib.Razor { public partial class CircleGaugeMulti { [Parameter] public string Titolo { get; set; } = "Titolo"; [Parameter] public string Testo { get; set; } = "Testo"; [Parameter] public string StyleTitolo { get; set; } = "font-size: 3em; font-weight:bold; fill: white;"; [Parameter] public string StyleTesto { get; set; } = "font-size: 1em; fill: gray;"; [Parameter] public List ListInner { get; set; } = new List(); [Parameter] public List ListOuter { get; set; } = new List(); /// /// Indica se mostrare o meno il btn centrale /// [Parameter] public bool ShowCircleBtn { get; set; } = false; /// /// Valore MASSIMO da rappresentare (=100%) /// [Parameter] public int maxVal { get; set; } = 0; /// /// Spessore dei cerchi da disegnare /// [Parameter] public int sWidth { get; set; } = 10; /// /// Raggio cerchio interno (0..100) /// [Parameter] public int innRad { get; set; } = 70; /// /// Raggio cerchio esterno (0..100) /// [Parameter] public int outRad { get; set; } = 85; private bool showOuter { get => ListOuter.Count > 0; } protected string calcDash(int currRad, int currVal) { string answ = $"{currRad * 6.2832 * currVal / maxVal:N0} {currRad * 6.2832 * (maxVal - currVal) / maxVal:N0}"; return answ; } /// /// Parametri per disegno segmento circolare /// public class CircSegm { public int Value { get; set; } = 0; public string Color { get; set; } = "#00FF66"; } } }