feat: add parameter choice for chart data

This commit is contained in:
Alexis Fourmaux 2026-05-12 16:40:39 +02:00
parent d1840441c5
commit 28baab1956
3 changed files with 55 additions and 9 deletions

View file

@ -4,7 +4,7 @@ function renderChart(points) {
const labels = points.map(p => formatPeriod(p.period));
const data = points.map(p => p.delta_m3);
new Chart(canvas, {
let chart = new Chart(canvas, {
type: "bar",
data: {
labels,
@ -24,6 +24,8 @@ function renderChart(points) {
},
},
});
return chart;
}
function formatPeriod(isoString) {