diff --git a/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx b/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx index 8455cdc536d..3e1af114609 100644 --- a/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx +++ b/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx @@ -577,6 +577,8 @@ export class DataTable extends React.Component<{ @computed private get tableCaption(): React.ReactElement | null { if (this.hasDimensionHeaders) return null + if (this.displayDimensions.length === 0) return null + const singleDimension = this.displayDimensions[0] const titleFragments = (singleDimension.display.columnName .attributionShort || diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx index 9004f813505..2a5110442d5 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx @@ -286,6 +286,8 @@ export class AbstractStackedChart @computed private get entitiesAsSeries(): readonly StackedRawSeries[] { + if (!this.yColumns.length) return [] + const { isProjection, owidRowsByEntityName } = this.yColumns[0] return this.selectionArray.selectedEntityNames .map((seriesName) => {