owid-grapher icon indicating copy to clipboard operation
owid-grapher copied to clipboard

StackedDiscreteBar: Negative values lead to incorrect bar placement

Open sophiamersmann opened this issue 10 months ago • 0 comments

Description

  • This chart looks broken because one of the indicators (Land use change) has negative values that stacked discrete bar charts don't support
  • This leads to incorrect bar placements

Expected behaviour

  • In the long term, we should probably support negative values for (discrete) stacked bar charts (see #1166)
  • For now, we should make sure that negative values don't break the chart (probably by ignoring them)

Steps to reproduce

  1. Go to https://ourworldindata.org/grapher/food-emissions-supply-chain?country=Apples~Bananas
  2. Note that bars overflow
  3. Hover over one of the bars
  4. Note that Land use change has a negative value

Screenshots

Screenshot 2024-04-09 at 09 54 36

sophiamersmann avatar Apr 09 '24 08:04 sophiamersmann