@php /** * Reusable bar chart (D75) — rendered by Chart.js (vendored, lazy-loaded by the two * analysis pages via resources/js/analysis.js). The figures are computed server-side; * we hand them to the chunk in a sibling JSON script and mirror them in a * visually-hidden table so screen readers (and no-JS) still get the values. * * @var array $rows * @var string $unit 'eur' | 'count' — drives the value-axis tick formatting */ $unit = $unit ?? 'count'; $cid = 'anchart-'.\Illuminate\Support\Str::random(10); $payload = [ 'unit' => $unit, 'labels' => array_map(fn ($r) => (string) $r['label'], $rows), 'values' => array_map(fn ($r) => (float) $r['value'], $rows), 'displays' => array_map(fn ($r) => (string) $r['display'], $rows), ]; @endphp @foreach ($rows as $r) @endforeach
{{ $aria ?? 'Chart data' }}
LabelValue
{{ $r['label'] }}{{ $r['display'] }}