diff --git a/src/Components/Charts/BentoBarChart.tsx b/src/Components/Charts/BentoBarChart.tsx index 37b26ae..515807e 100644 --- a/src/Components/Charts/BentoBarChart.tsx +++ b/src/Components/Charts/BentoBarChart.tsx @@ -64,7 +64,7 @@ const BentoBarChart = ({ height, width, units, title, onClick, colorTheme = 'def const cartesianGridVerticalCoordinatesGenerator: CartesianGridProps['verticalCoordinatesGenerator'] = ({ xAxis }) => { const points = [xAxis?.x ?? 0]; - for (let i = 0; i <= xAxis?.tickCount; i++) { + for (let i = 0; i <= data.length; i++) { points.push(points[i] + xAxis.bandSize); } return points; diff --git a/test/js/TestBarChart.tsx b/test/js/TestBarChart.tsx index 39c7a7d..d0a0690 100644 --- a/test/js/TestBarChart.tsx +++ b/test/js/TestBarChart.tsx @@ -16,6 +16,11 @@ const TestBarChart: React.FC = () => { { x: 'SB', y: 60 }, { x: 'AU', y: 30 }, { x: 'XA', y: 80 }, + { x: 'BB', y: 50 }, + { x: 'BC', y: 75 }, + { x: 'BD', y: 60 }, + { x: 'BE', y: 30 }, + { x: 'BF', y: 80 }, ]} units="management units" height={sizeStateFixed.height}