Skip to main content

max / makenotwork

532 B · 12 lines History Blame Raw
1 {# Sales-over-time bar chart. Shared by the item, project and user analytics
2 tabs, which rendered three byte-identical copies of this before. Expects
3 `bars` in the parent context. #}
4 <div class="chart-bars">
5 {% for bar in bars %}
6 <div class="chart-bar-col" data-tooltip="{{ bar.value }} / {{ bar.count }} sale{% if bar.count != 1 %}s{% endif %}">
7 <div class="chart-bar" style="--fill: {{ bar.height_pct }}%;"></div>
8 <div class="chart-bar-label">{{ bar.label }}</div>
9 </div>
10 {% endfor %}
11 </div>
12