@props([ 'rows', // [['label' =>, 'total' => Money, 'share' => float], ...] biggest first 'limit' => 8, ]) @php use App\Support\MoneyFormatter; $shown = collect($rows)->take($limit); $max = max(0.01, $shown->max(fn ($row) => $row['total']->toFloat()) ?? 0.01); @endphp {{-- One series, so every bar wears the same hue: bar length already says which is biggest, and colouring by size would spend the identity channel saying it twice. No legend either — the heading names what is plotted. --}}
merge(['class' => 'ranked']) }}> @foreach ($shown as $row)
{{ $row['label'] }}
@endforeach @if (count($rows) > $limit)

{{ __('chart.and_more', ['count' => count($rows) - $limit]) }}

@endif