mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-09 17:02:46 +02:00
up commande labourage queue
This commit is contained in:
parent
ca0ec580f5
commit
1345cc903b
9 changed files with 532 additions and 441 deletions
|
@ -1166,4 +1166,37 @@ if(dc ){
|
|||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const ctcCompletionSeries = {{ ctc_completion_series|json_encode|raw }};
|
||||
|
||||
console.log('ctcCompletionSeries',ctcCompletionSeries)
|
||||
// Exemple d'intégration dans un graphique Chart.js :
|
||||
// Pour chaque type, ajouter une série CTC si elle existe
|
||||
Object.keys(ctcCompletionSeries).forEach(function(type) {
|
||||
const data = ctcCompletionSeries[type].map(pt => ({ x: pt.date, y: pt.value }));
|
||||
// Ajoute la série au graphique correspondant (ex: name_count, hours_count...)
|
||||
// À adapter selon l'ID du canvas et la structure du graphique
|
||||
const canvasId = type.replace('_count','') + 'Chart';
|
||||
const canvas = document.getElementById(canvasId);
|
||||
if (!canvas) return;
|
||||
// On suppose que le graphique existe déjà, on ajoute la série CTC
|
||||
if (canvas.chart) {
|
||||
canvas.chart.data.datasets.push({
|
||||
label: 'CTC (Complète tes commerces)',
|
||||
data: data,
|
||||
borderColor: 'orange',
|
||||
backgroundColor: 'rgba(255,165,0,0.1)',
|
||||
fill: false,
|
||||
yAxisID: 'y',
|
||||
borderDash: [5,3],
|
||||
datalabels: {
|
||||
display: false
|
||||
}
|
||||
});
|
||||
canvas.chart.update();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue