linking demandes
This commit is contained in:
parent
0aa050b38b
commit
7f79ec3a9f
6 changed files with 190 additions and 10 deletions
|
@ -508,18 +508,21 @@
|
|||
|
||||
// Mettre à jour les statistiques
|
||||
function updateStats() {
|
||||
if (countData.length > 0) {
|
||||
if (Array.isArray(countData) && countData.length > 0) {
|
||||
const latestCount = countData[countData.length - 1];
|
||||
document.getElementById('currentCount').textContent = latestCount.value;
|
||||
document.getElementById('lastUpdate').textContent = new Date(latestCount.date).toLocaleDateString('fr-FR');
|
||||
}
|
||||
|
||||
if (completionData.length > 0) {
|
||||
if (Array.isArray(completionData) && completionData.length > 0) {
|
||||
const latestCompletion = completionData[completionData.length - 1];
|
||||
document.getElementById('currentCompletion').textContent = latestCompletion.value + '%';
|
||||
}
|
||||
|
||||
document.getElementById('dataPoints').textContent = Math.max(countData.length, completionData.length);
|
||||
document.getElementById('dataPoints').textContent = Math.max(
|
||||
Array.isArray(countData) ? countData.length : 0,
|
||||
Array.isArray(completionData) ? completionData.length : 0
|
||||
);
|
||||
}
|
||||
|
||||
// Configuration commune pour les graphiques
|
||||
|
@ -571,7 +574,7 @@
|
|||
datasets: [
|
||||
{
|
||||
label: "Nombre d'objets",
|
||||
data: countData?.map(d => ({ x: new Date(d.date), y: d.value })),
|
||||
data: Array.isArray(countData) ? countData.map(d => ({ x: new Date(d.date), y: d.value })) : [],
|
||||
borderColor: '#0d6efd',
|
||||
backgroundColor: 'rgba(13, 110, 253, 0.1)',
|
||||
borderWidth: 2,
|
||||
|
@ -581,7 +584,7 @@
|
|||
},
|
||||
{
|
||||
label: 'Pourcentage de complétion',
|
||||
data: completionData?.map(d => ({ x: new Date(d.date), y: d.value })),
|
||||
data: Array.isArray(completionData) ? completionData.map(d => ({ x: new Date(d.date), y: d.value })) : [],
|
||||
borderColor: '#198754',
|
||||
backgroundColor: 'rgba(25, 135, 84, 0.1)',
|
||||
borderWidth: 2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue