69 lines
1.8 KiB
C#
69 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.Components.Web;
|
|
|
|
namespace Egw.Core.Razor.Comp
|
|
{
|
|
public partial class CircleGauge
|
|
{
|
|
[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 string strokeColorVal { get; set; } = "#00FF66";
|
|
|
|
/// <summary>
|
|
/// Valore da rappresentare
|
|
/// </summary>
|
|
[Parameter]
|
|
public int currVal { get; set; } = 0;
|
|
/// <summary>
|
|
/// Valore MASSIMO da rappresentare (=100%)
|
|
/// </summary>
|
|
[Parameter]
|
|
public int maxVal { get; set; } = 0;
|
|
|
|
|
|
/// <summary>
|
|
/// Spessore dei cerchida disegnare
|
|
/// </summary>
|
|
[Parameter]
|
|
public int sWidth { get; set; } = 10;
|
|
|
|
|
|
/// <summary>
|
|
/// Raggio cerchio interno (0..100)
|
|
/// </summary>
|
|
[Parameter]
|
|
public int innRad { get; set; } = 70;
|
|
|
|
/// <summary>
|
|
/// Raggio cerchio esterno (0..100)
|
|
/// </summary>
|
|
[Parameter]
|
|
public int outRad { get; set; } = 85;
|
|
|
|
private bool showOuter
|
|
{
|
|
get => currVal > maxVal;
|
|
}
|
|
|
|
private int valInner
|
|
{
|
|
get => currVal < maxVal ? currVal : maxVal;
|
|
}
|
|
private int valOuter
|
|
{
|
|
get => currVal < maxVal ? 0 : currVal - maxVal;
|
|
}
|
|
|
|
}
|
|
} |