a
This commit is contained in:
parent
5cf2bafb03
commit
d40a985a32
1437
Vue/Accueilassure/index copy.php
Executable file
1437
Vue/Accueilassure/index copy.php
Executable file
File diff suppressed because it is too large
Load Diff
|
|
@ -1025,98 +1025,6 @@
|
|||
plugins: [ChartDataLabels]
|
||||
});
|
||||
|
||||
// Graphique des dépenses par garantie
|
||||
const dataConso = <?= $dataConsoParGaranties ?>;
|
||||
const barCtx = document.getElementById('depensesChart').getContext('2d');
|
||||
const barChart = new Chart(barCtx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: dataConso.garanties,
|
||||
datasets: [{
|
||||
label: 'Dépenses',
|
||||
data: dataConso.depenses,
|
||||
backgroundColor: 'rgba(54, 162, 235, 0.7)',
|
||||
borderColor: 'rgba(54, 162, 235, 1)',
|
||||
borderWidth: 1
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
annotation: {
|
||||
annotations: dataConso.plafonds.map((plafond, index) => {
|
||||
if (plafond === null) return null;
|
||||
|
||||
return {
|
||||
type: 'line',
|
||||
yMin: plafond,
|
||||
yMax: plafond,
|
||||
borderColor: 'rgba(255, 99, 132, 0.7)',
|
||||
borderWidth: 2,
|
||||
borderDash: [6, 6],
|
||||
label: {
|
||||
content: `Plafond: ${formatMoney(plafond)}`,
|
||||
enabled: true,
|
||||
position: 'right'
|
||||
}
|
||||
};
|
||||
}).filter(annotation => annotation !== null)
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
const plafond = dataConso.plafonds[context.dataIndex];
|
||||
let tooltip = `Dépenses: ${formatMoney(context.parsed.y)}`;
|
||||
|
||||
if (plafond !== null) {
|
||||
const pourcentage = Math.min(100, Math.round((context.parsed.y / plafond) * 100));
|
||||
tooltip += ` (${pourcentage}% du plafond)`;
|
||||
} else {
|
||||
tooltip += ' (plafond illimité)';
|
||||
}
|
||||
|
||||
return tooltip;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: `Montant des dépenses`,
|
||||
font: {
|
||||
weight: 'bold'
|
||||
}
|
||||
},
|
||||
ticks: {
|
||||
callback: function(value) {
|
||||
return formatMoney(value);
|
||||
}
|
||||
},
|
||||
suggestedMax: Math.max(...dataConso.depenses) * 1.5
|
||||
},
|
||||
x: {
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Garanties',
|
||||
font: {
|
||||
weight: 'bold'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Générer la légende au chargement et lors du redimensionnement
|
||||
generateCustomLegend(distributionChart, 'pieChartLegend');
|
||||
window.addEventListener('resize', function() {
|
||||
|
|
|
|||
|
|
@ -151,12 +151,6 @@
|
|||
<span class="fw-bold"><?= $this->nettoyer($prestataire['mobile']) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-muted small"><?= _("E-mail") ?></span>
|
||||
<span class="fw-bold"><?= $this->nettoyer($prestataire['email']) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user