ajout de suivi des parkings vélo
This commit is contained in:
parent
0611b28172
commit
4fbdcfc704
5 changed files with 37 additions and 5 deletions
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
<p>Historique des objets suivis (nombre et complétion).</p>
|
||||
{% for type, label in followup_labels %}
|
||||
<h2 id="title-{{ type }}"><i class="bi {{ followup_icons[type]|default('bi-question-circle') }}"></i> {{ label }}</h2>
|
||||
<h2 id="title-{{ type }}"><i class="bi {{ followup_icons[type]|default('bi-question-circle') }} fs-2"></i> {{ label }}</h2>
|
||||
<canvas id="{{ type }}Chart" width="600" height="300"></canvas>
|
||||
<div class="mb-3">
|
||||
{% set overpass_query = '[out:json][timeout:60];\narea["ref:INSEE"="' ~ stats.zone ~ '"]->.searchArea;\n(' ~ followup_overpass[type]|default('') ~ ');\n\n(._;>;);\n\nout meta;\n>;' %}
|
||||
|
@ -63,6 +63,8 @@
|
|||
<script src="/js/chartjs/chartjs-adapter-date-fns.js"></script>
|
||||
<script>
|
||||
const series = {{ series|json_encode|raw }};
|
||||
console.log('series',series)
|
||||
|
||||
const typeLabels = {
|
||||
fire_hydrant: 'Bornes incendie',
|
||||
charging_station: 'Bornes de recharge',
|
||||
|
@ -75,7 +77,8 @@
|
|||
laboratory: "Laboratoires d'analyse",
|
||||
school: 'Écoles',
|
||||
police: 'Commissariats',
|
||||
healthcare: 'Lieux de santé'
|
||||
healthcare: 'Lieux de santé',
|
||||
bicycle_parking: 'Parkings vélos'
|
||||
};
|
||||
function formatDelta(val) {
|
||||
if (val === null) return '-';
|
||||
|
@ -117,7 +120,7 @@
|
|||
// Mettre à jour le titre
|
||||
const titleElem = document.getElementById('title-' + baseType);
|
||||
if (titleElem) {
|
||||
titleElem.innerHTML = `${typeLabels[baseType]} (N = ${lastCount}, complétion = ${lastCompletion}%)`;
|
||||
titleElem.innerHTML = `${typeLabels[baseType]} ( ${lastCount}, ${lastCompletion}%)`;
|
||||
}
|
||||
// Créer le graphique
|
||||
new Chart(canvas, {
|
||||
|
@ -148,7 +151,7 @@
|
|||
plugins: {
|
||||
title: {
|
||||
display: true,
|
||||
text: `${typeLabels[baseType]} (N = ${lastCount}, complétion = ${lastCompletion}%)`
|
||||
text: `${typeLabels[baseType]} ( ${lastCount}, ${lastCompletion}%)`
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue