Skip to content

Commit

Permalink
fix(admin): fix chart type failures when y dimension is missing (#4273)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber authored Dec 10, 2024
1 parent 6fb21e8 commit d47497f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ export class AbstractStackedChart

@computed
private get entitiesAsSeries(): readonly StackedRawSeries<number>[] {
if (!this.yColumns.length) return []

const { isProjection, owidRowsByEntityName } = this.yColumns[0]
return this.selectionArray.selectedEntityNames
.map((seriesName) => {
Expand Down

0 comments on commit d47497f

Please sign in to comment.