Aggiunta gestione icona + bar % valore
This commit is contained in:
@@ -22,8 +22,16 @@
|
||||
{
|
||||
<div>@item.Title</div>
|
||||
}
|
||||
<div>
|
||||
<h5> <b>@item.Value</b></h5>
|
||||
<div class="d-flex flex-column">
|
||||
<div><h5><b>@item.Value</b></h5></div>
|
||||
@if (item.ShowBar)
|
||||
{
|
||||
<div class="w-100">
|
||||
<div class="progress" style="height: 0.3rem;">
|
||||
<div class="progress-bar" role="progressbar" style="@percProgress(item.ValueNum, item.MinVal, item.MaxVal)" aria-valuenow="@item.ValueNum" aria-valuemin="@item.MinVal" aria-valuemax="@item.MaxVal"></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -47,6 +47,15 @@ namespace MP.MONO.UI.Components
|
||||
ListRecords = await MMDataService.MachineParameters();
|
||||
}
|
||||
|
||||
protected string percProgress(double num, double minVal, double maxVal)
|
||||
{
|
||||
string answ = "width: 0%;";
|
||||
double den = (maxVal - minVal) != 0 ? (maxVal - minVal) : 1;
|
||||
double ratio = ((double)num) / den;
|
||||
answ = $"width: {ratio:P0};";
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
"DisplFormat": "N1",
|
||||
"IsNumeric": true,
|
||||
"EnablePlot": true,
|
||||
"ShowGauge": true,
|
||||
"ShowBar": true,
|
||||
"CssIcon": "fa-solid fa-bolt"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user