@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $monthly = $data['monthly_histogram']; $rows = $data['status_table']; $fmtNum = function ($v, $unit = '') { if ($v === null) return '—'; $s = is_numeric($v) ? number_format((float) $v, is_float($v) && fmod($v, 1) !== 0.0 ? 1 : 0, ',', ' ') : (string) $v; return trim($s . ' ' . $unit); }; // Bar chart geometry $chartW = 480; $chartH = 160; $padX = 30; $padY = 24; $barCount = max(count($monthly), 1); $maxVal = max(1, max(array_map(fn ($r) => (int) $r['count'], $monthly ?: [['count' => 0]]))); $barSpace = ($chartW - 2 * $padX) / $barCount; $barWidth = max(8, $barSpace * 0.6); $bars = []; foreach ($monthly as $i => $r) { $h = ($r['count'] / $maxVal) * ($chartH - 2 * $padY); $x = $padX + $i * $barSpace + ($barSpace - $barWidth) / 2; $y = $chartH - $padY - $h; $bars[] = [ 'x' => $x, 'y' => $y, 'w' => $barWidth, 'h' => $h, 'label' => $r['label'], 'value' => $r['count'], 'cx' => $x + $barWidth / 2, ]; } @endphp @section('content')
| Immatriculation | Marque / Modèle | Site | Cause | Durée |
|---|---|---|---|---|
| {{ $r['plate'] }} | {{ $r['model'] }} | {{ $r['site'] }} | {{ $r['cause'] }} | {{ $r['duration'] }} |
Aucun véhicule immobilisé.
@endifPas d'historique de statut disponible.
@endif @endsection