owid-grapher
owid-grapher copied to clipboard
We need a "Missing data strategy" in stacked discrete bar charts
Core problem
We need to handle missing data in stacked discrete bar charts. Currently, the default behaviour is to treat missing data as zeros, but this causes lots of unacceptable chart views.
For example, Per capita energy from fossil fuels, nuclear and renewables chart shows that Norway and Sweden were 100% renewable in 1965. This happens simply because there is no data for fossil fuels until several years later.
Proposed solution
- The "Missing data strategy" option should be available for stacked discrete bar charts.
- Additionally, the default choice would be to hide entities with missing data.
- This is the safest option, but we would need to see how this default would affect existing charts.
Context
For more context and several examples of unacceptable chart views: see https://github.com/owid/owid-issues/issues/1257
@pabloarosado could you outline a bit more what you mean with missing data strategy? What should be the conditions to hide which kinds of data?
Hi @danyx23, what I meant is that, while for stacked area charts we have a missing data strategy dropdown menu (e.g. this chart)
for stacked discrete bar charts (e.g. this chart) we don't have that menu.
Currently, in stacked discrete bar charts, nans are treated like zeros (which would be the expected behavior if you chose "Show entities with missing data"). However, you may not want that and would prefer to hide entities if they have nans.