Natixar / natixar-frontend

The static front end of the Natixar SaaS platform
0 stars 5 forks source link

Bar Chart (and Intensity Chart) Displays Bogus Era Split #116

Closed lepeuvedic-natixar closed 2 weeks ago

lepeuvedic-natixar commented 2 weeks ago

Problem

In this case, we have a scope 1 biomass emission for 299.3 t in Feb 2023 followed by a 37.9 t emission caused by upstream transport (scope 3) in May 2023.

The values are in the donut expandable bars. The dev server was set up to send only 2 random compressed data points, so that's what we get from the back-end. Correct Donut for Always Same

The donut looks OK, shows the total and correct proportions.

The Bar Chart shows this: Always the Same

In other terms, both emissions are defined as era O and era U (when in fact biomass in scope 1 is O and transport in scope 3 is U) and the heights are twice what is expected. This is also a regression since I've WRITTEN a version where the Bar Chart matched the Donut.

My logs tell me that the earliest of the two starts at day 249 (from June 12 th 2022) and the latest one finishes at day 761. The backend is queried in 1M but choses to answer in 1d (the dev backend cannot calculate the exact duration of months and does not validate the alignment)

Steps to Reproduce

  1. Repeat switching between GHG Protocol and BEGES until the random data resembles the attached images.
  2. Observe the massive discrepancy between Bar Chart totals and Donut total.

Desired Behavior

If you are going to fix this, can you directly drop this breakdown by era which does not add in value, considering we also have a filter, and rewrite clean code that does a breakdown by group of categories SAME AS THE DONUT WITH THE SAME COLOURS

ChrisNatixar commented 2 weeks ago

Scope settings issue not bug