From ce5f45eadeb33f9b29b702e3e4ae4a1aadaade36 Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Mon, 12 Apr 2021 16:32:48 +0200 Subject: [PATCH] Fix data bug --- app/main/static/js/charges.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/main/static/js/charges.js b/app/main/static/js/charges.js index c9c8576..255a3fa 100644 --- a/app/main/static/js/charges.js +++ b/app/main/static/js/charges.js @@ -298,13 +298,14 @@ function build_chart(div_selector, data_url, entity_name, category_type) { // 1- Get the charge sum for each category over periods // That will leave '0' to categories with no charge at all // TODO: to be done with Object.keys, Object.values and d3 filtering methods + // var categories_total_charge = {} data.forEach(function (d) { Object.keys(d).forEach(function (k) { if (categories_total_charge.hasOwnProperty(k)) { categories_total_charge[k] += +d[k] } else { - categories_total_charge[k] = 0 + categories_total_charge[k] = d[k] } } ) -- libgit2 0.21.2