Skip to content

Commit

Permalink
Merge pull request #16 from bento-platform/fix/bar-grid-ticks
Browse files Browse the repository at this point in the history
fix(charts): correct # of bar chart dividing lines
  • Loading branch information
davidlougheed authored Feb 12, 2024
2 parents 369b347 + a91b4f1 commit 44c2ef8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Components/Charts/BentoBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions test/js/TestBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 44c2ef8

Please sign in to comment.