Graphique évolution mensuels avec courbe et barre

This commit is contained in:
KONE SOREL 2025-12-26 09:45:20 +00:00
parent 073ae89733
commit e5dcc05ac5

View File

@ -273,36 +273,54 @@
const dataClaimsMonth = <?= $dataTabClaimsMonth ?>;
new Chart(document.getElementById('claimsLine'), {
type: 'line',
data: {
labels: dataClaimsMonth.months,
datasets: [
{
type: 'line',
label: "Cumulés",
data: dataClaimsMonth.monthlyClaims, // cumulés
tension: 0.4,
fill: true,
borderColor: "blue",
backgroundColor: "rgba(0,0,255,0.2)"
backgroundColor: "rgba(0,0,255,0.2)",
tension: 0.4,
yAxisID: 'y'
},
{
type: 'bar',
label: "Mensuels",
data: dataClaimsMonth.singleClaims, // valeurs brutes du mois
tension: 0.4,
fill: false,
data: dataClaimsMonth.singleClaims, // valeurs brutes
backgroundColor: "rgba(255,0,0,0.5)",
borderColor: "red",
backgroundColor: "rgba(255,0,0,0.2)"
borderWidth: 1,
yAxisID: 'y'
}
]
},
options: {
responsive: true,
interaction: {
mode: 'index',
intersect: false
},
stacked: false,
scales: {
y: { beginAtZero: false }
y: {
beginAtZero: true,
title: {
display: true,
text: "Montant des sinistres"
}
},
x: {
title: {
display: true,
text: "Mois"
}
}
}
}
});
// Sinistralité
new Chart(document.getElementById('lossRatioBar'), {
type: 'bar',