{# Burndown chart (#206). Expects a `snapshots` variable — a list of dicts with keys: snapshot_date, todo, doing, review, done. If fewer than 2 snapshots, shows a placeholder message. Otherwise renders an SVG polyline of "remaining" (todo+doing+review) over time. Also expects `color` for the line stroke. #} {% if snapshots and snapshots | length >= 2 %} {% set w = 200 %} {% set h = 60 %} {% set pad = 2 %} {% set n = snapshots | length %} {# Compute remaining (non-done) for each snapshot #} {% set remaining = [] %} {% for s in snapshots %} {% set _ = remaining.append(s.todo + s.doing + s.review) %} {% endfor %} {% set mx = [remaining | max, 1] | max %} {# Build SVG polyline points #} {% set points = [] %} {% for r in remaining %} {% set x = pad + (loop.index0 / (n - 1)) * (w - 2 * pad) %} {% set y = pad + ((mx - r) / mx) * (h - 2 * pad) %} {% set _ = points.append("%.1f,%.1f" | format(x, y)) %} {% endfor %} {# Filled area: polyline + close along the bottom #} {% set area_points = points | join(" ") + " %.1f,%.1f %.1f,%.1f" | format(w - pad, h - pad, pad, h - pad) %} {% else %}
Pas encore de données
{% endif %}