Skip to content

Commit

Permalink
🐛 (stacked bar) use 'add' entities instead of 'select'
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Oct 9, 2024
1 parent 6cf3fe2 commit 0e30f7a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -712,12 +712,10 @@ export class Grapher
const seriesStrategy =
this.chartInstance.seriesStrategy ||
autoDetectSeriesStrategy(this, true)
const hasSingleEntity =
this.selection.selectedEntityNames.length === 1 &&
(this.hideEntityControls || !this.canAddEntities)
const isEntityStrategy = seriesStrategy === SeriesStrategy.entity
const hasSingleEntity = this.selection.numSelectedEntities === 1
const hideLegend =
this.hideLegend ||
(seriesStrategy === SeriesStrategy.entity && hasSingleEntity)
this.hideLegend || (isEntityStrategy && hasSingleEntity)
return !hideLegend
}

Expand Down Expand Up @@ -3294,6 +3292,7 @@ export class Grapher
this.canSelectMultipleEntities &&
(this.isLineChart ||
this.isStackedArea ||
this.isStackedBar ||
this.isDiscreteBar ||
this.isStackedDiscreteBar)
)
Expand Down

0 comments on commit 0e30f7a

Please sign in to comment.