{# Donut chart (Hani #1 2026-10-24): the same ring as the header gauges, for a percentage with warning and critical levels. value: 0-100 or none; caption under the figure; detail: one short line. #} {% macro donut(value, warn, crit, caption, detail=None, size='md') -%} {%- set v = value if value is not none else 0 -%} {%- set level = 'is-critical' if v >= crit else ('is-warning' if v >= warn else '') -%}
{% if value is none %}–{% else %}{{ '%.0f'|format(v) }}%{% endif %}
{{ caption }}{% if detail %}{{ detail }}{% endif %}
{%- endmacro %}