owid / owid-grapher

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

DualAxis: Multi-line y-axis labels push tick labels into the chart area #2793

Open sophiamersmann opened 11 months ago

sophiamersmann commented 11 months ago

Description

See screenshot.

Expected behaviour

More space is given to the label when it breaks into multiple lines.

Steps to reproduce

  1. Go to https://ourworldindata.org/grapher/learning-adjusted-years-of-schooling-marimekko
  2. Look at the chart on a smaller screen (so the y-axis label breaks into two lines)
  3. Note that the tick labels aren't visible

Screenshots

Looks good:

Screenshot 2023-10-18 at 17 39 56

When the y-axis label breaks into multi lines, the tick labels are not visible since they are pushed into the chart area:

Screenshot 2023-10-18 at 17 40 38

Additional context

Might happen for other chart types as well.

sophiamersmann commented 4 months ago

Happens for all charts that have a DualAxis. Scatter plot example: https://ourworldindata.org/grapher/pig-production-greenhouse-gas-emissions-vs-cost-to-animal-welfare