{{-- Expects: $kpi (App\Models\Kpi), $chart (array from App\Support\KpiChart::build) --}}

{{ $kpi->name }} — last 12 months

{{ $kpi->thresholdSummary() }}@if ($kpi->unit_label) · unit: {{ $kpi->unit_label }}@endif

@if (($chart['type'] === 'line' && empty($chart['points'])) || ($chart['type'] === 'milestone' && empty($chart['markers'])))

No entries in the last 12 months.

@elseif ($chart['type'] === 'line') {{-- Threshold zone bands (10% status washes) --}} @foreach ($chart['bands'] as $band) @endforeach {{-- Gridlines + y ticks --}} @foreach ($chart['gridlines'] as $grid) {{ $grid['label'] }} @endforeach {{-- Threshold / target reference lines --}} @foreach ($chart['refLines'] as $ref) {{ $ref['label'] }} @endforeach {{-- Value line (gaps split the path; pathLength normalizes the draw-in animation) --}} @foreach ($chart['paths'] as $path) @endforeach {{-- Points, status-colored with a 2px surface ring --}} @foreach ($chart['points'] as $point) {{ $point['title'] }} @endforeach {{-- End value label (selective direct label) --}} @if ($chart['endLabel']) {{ $chart['endLabel']['text'] }} @endif {{-- Month labels --}} @foreach ($chart['monthLabels'] as $label) {{ $label['label'] }} @endforeach @else {{-- Milestone timeline: met / missed markers per month --}} @foreach ($chart['markers'] as $marker) {{ $marker['title'] }} {{ $marker['glyph'] }} @endforeach @foreach ($chart['monthLabels'] as $label) {{ $label['label'] }} @endforeach @endif