Add sum on chart

This commit is contained in:
Edgar P. Burkhart 2022-05-24 17:31:45 +02:00
parent f6dc54f87d
commit 408e605c7b
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 23 additions and 2 deletions

View file

@ -21,6 +21,8 @@
} }
.chart .value { .chart .value {
padding: 0 var(--gap); padding: 0 var(--gap);
font-feature-settings: "tnum", "ss01";
text-align: right;
} }
.chart .bar { .chart .bar {
width: 0; width: 0;
@ -39,5 +41,19 @@
.chart .left .bar {border-radius: var(--radius) 0 0 var(--radius)} .chart .left .bar {border-radius: var(--radius) 0 0 var(--radius)}
.chart .right .bar {border-radius: 0 var(--radius) var(--radius) 0} .chart .right .bar {border-radius: 0 var(--radius) var(--radius) 0}
.chart .bar_m {background: var(--red)} .chart .bar_m {background: var(--red-1)}
.chart .bar_p {background: var(--green)} .chart .bar_p {background: var(--green-1)}
.chart .bar span {
position: absolute;
display: inline-block;
white-space: nowrap;
margin: 0 var(--gap);
font-weight: 650;
top: .5rem;
line-height: 1.5rem;
height: 1.5rem;
font-feature-settings: "tnum", "ss01";
}
.chart .right .bar span {left: 0}
.chart .left .bar span {right: 0}

View file

@ -29,6 +29,9 @@
--red: #bf1500; --red: #bf1500;
--green: var(--theme-2); --green: var(--theme-2);
--red-1: #f21b00;
--green-1: var(--theme-1);
--radius: 2px; --radius: 2px;
} }

View file

@ -59,6 +59,7 @@
class="bar tot" class="bar tot"
style="width:{% widthratio cat.sum cat_lim_m 100 %}%" style="width:{% widthratio cat.sum cat_lim_m 100 %}%"
title="{{ cat.sum }}"> title="{{ cat.sum }}">
{% pmvalue cat.sum %}
</div> </div>
{% endif %} {% endif %}
</div> </div>
@ -73,6 +74,7 @@
class="bar tot" class="bar tot"
style="width:{% widthratio cat.sum cat_lim 100 %}%" style="width:{% widthratio cat.sum cat_lim 100 %}%"
title="{{ cat.sum }}"> title="{{ cat.sum }}">
{% pmvalue cat.sum %}
</div> </div>
{% endif %} {% endif %}
</div> </div>