owid / owid-grapher

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

StackedArea: Allow setting y-axis min and max #3930

Open lucasrodes opened 1 month ago

lucasrodes commented 1 month ago

Core problem

Users can't select the y-axis ranges (min and max) in a stacked area chart in admin.

Proposed solution

In another chart type, e.g. LineChart, the user has the options under the 'Customize' tab. We could have the same options for 'StackedArea' too.

Context

Apparently, one workaround is to temporarily change the chart type to LineChart, edit the y-axis range, and return to the StackedArea chart.

https://github.com/user-attachments/assets/f765377f-25cf-4ddc-abab-81ac5696b431

marcelgerber commented 3 weeks ago

This is probably super easy to do, just change https://github.com/owid/owid-grapher/blob/3a9fa35b83bdbcb850915e0de03097a4b9997ffb/adminSiteClient/EditorFeatures.tsx#L16-L19.

The only thing we will want to check is whether relative mode still behaves the way it should when a custom max has been set.