diff --git a/src/shared/components/plots/MultipleCategoryBarPlot.tsx b/src/shared/components/plots/MultipleCategoryBarPlot.tsx index a7b8a663bac..eb22fafb804 100644 --- a/src/shared/components/plots/MultipleCategoryBarPlot.tsx +++ b/src/shared/components/plots/MultipleCategoryBarPlot.tsx @@ -433,7 +433,8 @@ export default class MultipleCategoryBarPlot extends React.Component< if (this.data.length > 0) { if ( this.props.sortByOption === SortByOptions.SortByTotalSum || - (this.props.sortByOption !== '' && + (this.props.sortByOption && + this.props.sortByOption !== '' && this.props.sortByOption !== SortByOptions.Alphabetically) ) { return getSortedMajorCategories( @@ -947,6 +948,8 @@ export default class MultipleCategoryBarPlot extends React.Component< } render() { + console.log(this.labels); + console.log(this.props.sortByOption); if (!this.data.length) { return
No data to plot.
; } diff --git a/src/shared/components/plots/MultipleCategoryBarPlotUtils.ts b/src/shared/components/plots/MultipleCategoryBarPlotUtils.ts index ffa8e0b9cc4..7915268fce3 100644 --- a/src/shared/components/plots/MultipleCategoryBarPlotUtils.ts +++ b/src/shared/components/plots/MultipleCategoryBarPlotUtils.ts @@ -105,7 +105,7 @@ export function sortDataByCategory( } export function getSortedMajorCategories( data: IMultipleCategoryBarPlotData[], - sortByOption: string | undefined + sortByOption: string ): string[] { if (sortByOption === 'SortByTotalSum') { const majorCategoryCounts: { [key: string]: number } = {};