diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx index 207959ea00..a5b257fb9c 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx @@ -1410,9 +1410,9 @@ export class LineChart } @computed private get yAxisConfig(): AxisConfig { - // TODO: enable nice axis ticks for linear scales return new AxisConfig( { + nice: this.manager.yAxisConfig?.scaleType !== ScaleType.log, // if we only have a single y value (probably 0), we want the // horizontal axis to be at the bottom of the chart. // see https://github.com/owid/owid-grapher/pull/975#issuecomment-890798547 diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx index 5b40a3086b..812da2c381 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx @@ -253,8 +253,13 @@ export class AbstractStackedChart } @computed private get yAxisConfig(): AxisConfig { - // TODO: enable nice axis ticks for linear scales - return new AxisConfig(this.manager.yAxisConfig, this) + return new AxisConfig( + { + nice: true, + ...this.manager.yAxisConfig, + }, + this + ) } // implemented in subclasses