{# Widget partial: Pivot table (cross-tab) Expects: widget (dict), data (dict with columns/rows), widget_id (int), config (dict), pivot_data (dict with row_headers, col_headers, pivot_rows) #} {% if error %}
{{ error }}
{% elif pivot_data and pivot_data.row_headers and pivot_data.col_headers %}
{% for ch in pivot_data.col_headers %} {% endfor %} {% for rh in pivot_data.row_headers %} {% set row_idx = loop.index0 %} {% for val in pivot_data.pivot_rows[row_idx] %} {% endfor %} {% endfor %}
{{ config.row_field if config and config.row_field else "Row" }} {{ ch }}
{{ rh }} {% if val == 0 %}-{% else %}{{ val }}{% endif %}
{% elif data and data.columns %}
Configure pivot fields (row_field, col_field, value_field) in widget config.
Available columns: {{ data.columns | join(", ") }}
{% else %}

No data

{% endif %}