This commit is contained in:
KONE SOREL 2025-12-23 16:13:02 +00:00
parent f824e02558
commit baab67d018
3 changed files with 41 additions and 1 deletions

View File

@ -63,6 +63,10 @@ class ControleurAccueil extends Controleur {
28900000,
30000000
];
// SINISTRALITÉ (manquante jusquici)
$lossRatioLabels = ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin"];
$lossRatioValues = [62, 68, 71, 65, 73, 69]; // %
$this->genererVue(
array
@ -73,7 +77,9 @@ class ControleurAccueil extends Controleur {
'claimsLabels' => $claimsLabels,
'claimsValues' => $claimsValues,
'months' => $months,
'monthlyCotisations' => $monthlyCotisations
'monthlyCotisations' => $monthlyCotisations,
'lossRatioLabels' => $lossRatioLabels,
'lossRatioValues' => $lossRatioValues
)
);
}

View File

@ -71,6 +71,15 @@
</div>
</div>
<div class="grid-2">
<div class="card">
<h3><?= _('Sinistralité') ?></h3>
<div class="chart">
<canvas id="lossRatioBar"></canvas>
</div>
</div>
</div>
</div>
<script>
@ -108,4 +117,26 @@
}
}
});
// Sinistralité
new Chart(document.getElementById('lossRatioBar'), {
type: 'bar',
data: {
labels: <?= json_encode($lossRatioLabels) ?>,
datasets: [{
label: "Sinistralité (%)",
data: <?= json_encode($lossRatioValues) ?>
}]
},
options: {
scales: {
y: {
beginAtZero: true,
max: 100
}
}
}
});
</script>

View File

@ -637,6 +637,9 @@ console.groupEnd();
<!-- Service Worker Registration -->
<script src="/Js/sw-register.js?ver=2025.12.22.00"></script>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<script>
// CORRECTION URGENTE - FORCE LE BON MENU
document.addEventListener('DOMContentLoaded', function() {