owid-grapher
owid-grapher copied to clipboard
Missing country name in title for faceted single-entity StackedAreaChart
Description
In a faceted-by-entity StackedAreaChart, with only a single entity selected, there is no mention of the country being shown, making it impossible to know what country one is looking at.
Expected behaviour
The country name should be visible somewhere, e.g. in the chart title.
Steps to reproduce
Steps to reproduce the behavior:
- Go to https://ourworldindata.org/explorers/population-and-demography?Metric=Population+by+broad+age+group&Sex=Both+sexes&Age+group=Total&Projection+Scenario=None&country=~CHN
- Notice that there is no mention of the country (China) we're looking at anywhere, aside from the entity selection sidebar.
Screenshots
Context
Originally mentioned by @CGiattino here: https://owid.slack.com/archives/C03KRR7TH0A/p1657138370093749
- Very related: https://github.com/owid/owid-grapher/issues/1124
This is happening because addCountryMode == EntitySelectionMode.MultipleEntities
in this case, and because of this line in Grapher.tsx
:
https://github.com/owid/owid-grapher/blob/1c1f54fc4be4c2d65ef277bfc8943fb3fe29c831/packages/%40ourworldindata/grapher/src/core/Grapher.tsx#L1215
It's not directly linked to faceting.
Re-opening this because even though this issue has been fixed in explorers, it persists in grapher charts:

(Note that there is no mention of the entity)
I came across this while working on #2063.
Re-opening this because even though this issue has been fixed in explorers, it persists in grapher charts:
Is this happening on your local setup? Because I cannot easily repro on the live site, with the same chart.
Ah sorry, my bad, this particular chart is published with single-entity selection. To reproduce:
- go to https://owid.cloud/admin/charts/298/edit
- go to the "Data" tab
- change selection to "User can add and remove data"
- notice that "Sweden" is not displayed in the title anymore