owid-grapher icon indicating copy to clipboard operation
owid-grapher copied to clipboard

LineChart/StackedArea: Improve labelling when space is tight

Open sophiamersmann opened this issue 11 months ago • 1 comments

Description

  • When space is tight, the labelling algorithm used in line charts and stacked area charts doesn't do a good job
  • This has been noted by Pablo A when trying to prepare a mobile static chart for data insights (see screenshots below)
  • This is also the reason why we don't re-use the labelling algorithm for slope charts

Expected behaviour

  • Show as many labels as possible, even when space is tight

Steps to reproduce

  1. Go to https://owid.cloud/admin/charts/383/edit
  2. Click on the 'Export' tab
  3. Switch to the mobile version

Screenshots

When space is tight:

Screenshot 2024-03-15 at 12 02 04

If there is more space (here achieved by removing text elements):

Screenshot 2024-03-15 at 12 02 29

sophiamersmann avatar Mar 15 '24 11:03 sophiamersmann