Skip to content

Commit

Permalink
Add max value for charts
Browse files Browse the repository at this point in the history
  • Loading branch information
mkly committed Jul 17, 2023
1 parent 70fdf9c commit cb7a8aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/GroupBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ export default function GroupBarChart({ groupTable }: Props) {
setActiveCategories(new Map(activeCategories));
};

const height =
const height = Math.min(
Math.max(activeCategories.size || 1, 2) *
(groupTable.rows.length || 1) *
20;
(groupTable.rows.length || 1) *
20,
4000,
);

return (
<div style={{ height }} className={`w-full`}>
Expand Down

0 comments on commit cb7a8aa

Please sign in to comment.