up infos vélo

This commit is contained in:
Tykayn 2025-07-15 23:23:32 +02:00 committed by tykayn
parent c0a1780fce
commit 0b760c20bc
7 changed files with 246 additions and 50 deletions

View file

@ -192,6 +192,10 @@
{% include 'admin/_followup_bicycle_parking_extra.html.twig' %}
{% endif %}
{% if theme == 'camera' %}
{% include 'admin/_followup_cameras_extra.html.twig' %}
{% endif %}
{% if overpass_query is defined %}
<a href="https://overpass-turbo.eu/?Q={{ overpass_query|url_encode }}" target="_blank" class="btn btn-outline-primary">
@ -481,7 +485,12 @@
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
<script>
const countData = {{ count_data|json_encode|raw }};
console.log(countData)
const completionData = {{ completion_data|json_encode|raw }};
// Mettre à jour les statistiques
@ -549,7 +558,7 @@
datasets: [
{
label: "Nombre d'objets",
data: countData.map(d => ({ x: new Date(d.date), y: d.value })),
data: countData?.map(d => ({ x: new Date(d.date), y: d.value })),
borderColor: '#0d6efd',
backgroundColor: 'rgba(13, 110, 253, 0.1)',
borderWidth: 2,
@ -559,7 +568,7 @@
},
{
label: 'Pourcentage de complétion',
data: completionData.map(d => ({ x: new Date(d.date), y: d.value })),
data: completionData?.map(d => ({ x: new Date(d.date), y: d.value })),
borderColor: '#198754',
backgroundColor: 'rgba(25, 135, 84, 0.1)',
borderWidth: 2,