Commit 04f2b6e823278af87f69621f8d50777c4c471832
1 parent
50928b07
Exists in
master
and in
4 other branches
Fix period as category when value is integer
When period name is like '2021', was considered as a category to plot.
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
app/main/static/js/charges.js
... | ... | @@ -302,6 +302,9 @@ function build_chart(div_selector, data_url, entity_name, category_type) { |
302 | 302 | var categories_total_charge = {} |
303 | 303 | data.forEach(function (d) { |
304 | 304 | Object.keys(d).forEach(function (k) { |
305 | + if (k === 'period') { | |
306 | + return; | |
307 | + } | |
305 | 308 | if (categories_total_charge.hasOwnProperty(k)) { |
306 | 309 | categories_total_charge[k] += +d[k] |
307 | 310 | } else { | ... | ... |