owid / owid-grapher

A platform for creating interactive data visualizations
https://ourworldindata.org
MIT License
1.37k stars 230 forks source link

Legend displays bins with one value in a slightly confusing way #2003

Closed bastianherre closed 7 months ago

bastianherre commented 1 year ago

Core problem

In some charts it makes sense to have a bin that is just one value. Examples are our chart on Experience with electoral democracy or on the Share of women in parliament. A country that was never a democracy, or a parliament without any women, are special cases that deserve their own category.

Unfortunately, the legend does not handle this well: by default it displays the same value twice in the legend, at the start and end of the bin (as in the first example). This may confuse some users, as they may think there could be some rounding of values going on, etc.

image

Proposed solution

A neat solution for these cases would be for the Grapher to recognize these one-value bins, and to provide clearer labels (as in the second example).

Screenshot 2023-03-30 at 12 11 05

Alternatives

One alternative is leaving the Grapher as is. Few users may be genuinely confused, and it may be fine accepting that.

Another alternative is to do what I did for the second example. Here I added clear labels to each bin. It's a bit more work, but would do the trick just fine (as long as the labels don't get longer).

Context

Max encouraged me to bring this to your attention when he saw me adding labels to the women-in-parliament chart.

Please let me know if you have any questions! Thank you!

marcelgerber commented 1 year ago

I think this should be relatively easy to do as Bastian suggested, I added "internal-onboarding" for now

github-actions[bot] commented 7 months ago

This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.