{{-- Year-to-year compliance: an e-learning and a face-to-face trend line, with each year's figures lined up underneath its point. Needs: $yearly (AggregatesCompliance::yearlyCompliance), $trendHomeName. --}} @if(! empty($yearly)) @php $latest = end($yearly); $n = count($yearly); $teal = '#0E7C7B'; $amber = '#C2610C'; $change = fn ($c) => $c === null ? '' : ($c > 0 ? '▲ '.$c.'%' : ($c < 0 ? '▼ '.abs($c).'%' : 'No change')); @endphp
calendar_month

Year to Year Compliance

{{ $trendHomeName ?? 'All services' }} · {{ $latest['label'] }}: {{ $latest['pct'] }}% overall{{ $latest['change'] !== null ? ' ('.\Illuminate\Support\Str::lower($change($latest['change'])).')' : '' }}

E-learning Face to face
{{-- One column per year, directly under its point --}}
@foreach($yearly as $y)
{{ $y['label'] }}
{{ $y['pct'] }}% {{ $change($y['change']) }}
E-learning {{ $y['e_total'] ? $y['e_pct'].'%' : '—' }} Face to face {{ $y['f_total'] ? $y['f_pct'].'%' : '—' }}
{{ number_format($y['e_year']) }} {{ \Illuminate\Support\Str::plural('course', $y['e_year']) }} · {{ number_format($y['f_year']) }} {{ \Illuminate\Support\Str::plural('session', $y['f_year']) }} done
@endforeach

Running position at 31 December (current year: today), for current staff. Face to face is sessions attended out of those booked, so it can differ from the Compliance % tile, which counts each service’s required trainings. E-learning from before Segra comes from imported records, so earlier years may look better than they really were.

@endif