owid-grapher
owid-grapher copied to clipboard
Long StackedDiscreteBar labels should wrap
Core problem
Long labels will compress the amount of space left over for the graph itself (see slack discussion):
Proposed solution
A max-width cutoff of, say 25%, could be chosen and any labels wider than that could be broken into multiple lines when rendered by TextWrap. The cutoffs could also use px
sizes with breakpoints detected using the new isSmall
, isMedium
, and isLarge
grapher attributes.
Alternatives
We could leave line-breaking for authors to control manually and parse strings for a <br>
, \n
, or other newline symbol.
Progess
- https://github.com/owid/owid-grapher/pull/3341
- (to do) label wrapping for
DiscreteBar
charts