Skip to content

Commit

Permalink
Merge pull request #3830 from owid/fix-discrete-bar-sort
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber authored Jul 31, 2024
2 parents 23969c0 + dd46db5 commit aa2c967
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,14 @@ export class DiscreteBarChart
let sortByFunc: (item: DiscreteBarItem) => number | string | undefined
switch (this.sortConfig.sortBy) {
case SortBy.custom:
sortByFunc = (): undefined => undefined
if (this.seriesStrategy === SeriesStrategy.entity) {
sortByFunc = (item: DiscreteBarItem): number =>
this.selectionArray.selectedEntityNames.indexOf(
item.seriesName
)
} else {
sortByFunc = (): undefined => undefined
}
break
case SortBy.entityName:
sortByFunc = (item: DiscreteBarItem): string => item.seriesName
Expand Down

0 comments on commit aa2c967

Please sign in to comment.