Skip to content

Commit

Permalink
fix charts getting cut off
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Lai committed Jan 13, 2025
1 parent 6abbaf5 commit 4094ce9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/shared/components/plots/MultipleCategoryBarPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 <div className={'alert alert-info'}>No data to plot.</div>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function sortDataByCategory<D>(
}
export function getSortedMajorCategories(
data: IMultipleCategoryBarPlotData[],
sortByOption: string | undefined
sortByOption: string
): string[] {
if (sortByOption === 'SortByTotalSum') {
const majorCategoryCounts: { [key: string]: number } = {};
Expand Down

0 comments on commit 4094ce9

Please sign in to comment.