@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $series = $data['monthly_series']; $top = $data['top_vehicles']; $fmtNum = function ($v) { if ($v === null) return '—'; return is_numeric($v) ? number_format((float) $v, 0, ',', ' ') : (string) $v; }; // Bar chart geometry — total incidents per month. $chartW = 480; $chartH = 160; $padX = 30; $padY = 24; $barCount = max(1, count($series)); $barW = ($chartW - 2 * $padX) / max(1, $barCount) - 8; $maxV = 1; foreach ($series as $r) { if ($r['count'] > $maxV) $maxV = $r['count']; } $bars = []; foreach ($series as $i => $r) { $x = $padX + $i * (($chartW - 2 * $padX) / $barCount) + 4; $h = (($r['count']) / $maxV) * ($chartH - 2 * $padY); $y = $chartH - $padY - $h; $bars[] = ['x' => $x, 'y' => $y, 'w' => $barW, 'h' => $h, 'label' => $r['label'], 'value' => $r['count']]; } @endphp @section('content')
Codification télématique à venir — la séparation par type d'incident n'est pas encore disponible. Total période : {{ $fmtNum($kpis['total']['value']) }} incidents.
@endifPas d'incidents enregistrés sur la période.
@endif| Véhicule | Modèle | Incidents |
|---|---|---|
| {{ $r['plate'] }} | {{ $r['model'] }} | {{ $fmtNum($r['count']) }} |
Aucun véhicule concerné sur la période.
@endif @endsection