@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $dist = $data['distribution']; $topUsers = $data['top_users']; $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); }; // Histogram geometry $chartW = 480; $chartH = 160; $padX = 30; $padY = 24; $barCount = max(count($dist), 1); $maxVal = max(1, max(array_map(fn ($r) => (int) $r['count'], $dist ?: [['count' => 0]]))); $barSpace = ($chartW - 2 * $padX) / $barCount; $barWidth = max(8, $barSpace * 0.6); $bars = []; foreach ($dist 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')
Aucune donnée de distribution.
@endif| Immatriculation | Marque / Modèle | Conducteur | Km | Jours |
|---|---|---|---|---|
| {{ $r['plate'] }} | {{ $r['model'] }} | {{ $r['driver'] }} | {{ number_format($r['km'], 0, ',', ' ') }} | {{ $r['days'] }} |
Aucune donnée d'utilisation.
@endif @endsection