@foreach (var entry in Distribution)
{
var height = MaxCount > 0 ? entry.Count * 100 / MaxCount : 0;
@entry.Count
@(entry.Cost >= MaxCostLabel ? $"{MaxCostLabel}+" : entry.Cost.ToString())
}
@code {
[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;
}