Vibe Google Analytics
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="mana-curve">
|
||||
@foreach (var entry in Distribution)
|
||||
{
|
||||
var height = MaxCount > 0 ? (entry.Count * 100 / MaxCount) : 0;
|
||||
var height = MaxCount > 0 ? entry.Count * 100 / MaxCount : 0;
|
||||
<div class="mana-bar-container">
|
||||
<div class="mana-bar-label">@entry.Count</div>
|
||||
<div class="mana-bar" style="height: @($"{Math.Max(height, 5)}%")"></div>
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter, EditorRequired] public List<(int Cost, int Count)> Distribution { get; set; } = [];
|
||||
[Parameter][EditorRequired] public List<(int Cost, int Count)> Distribution { get; set; } = [];
|
||||
[Parameter] public int MaxCostLabel { get; set; } = 10;
|
||||
|
||||
private int MaxCount => Distribution.Count > 0 ? Distribution.Max(x => x.Count) : 0;
|
||||
|
||||
Reference in New Issue
Block a user