Skip to content

Commit

Permalink
feat ⚡️: adjusted xScale
Browse files Browse the repository at this point in the history
  • Loading branch information
squiles committed Dec 2, 2024
1 parent d4209bb commit 3757b40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/charts/bar/bars-stacked-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ const useBarsStackedState = (
yScale.range([0, chartHeight]);
yScaleInteraction.range([0, chartHeight]);
yScaleTimeRange.range([0, chartHeight]);
xScale.range([chartWidth, 0]);
xScale.range([0, chartWidth]);

const isMobile = useIsMobile();

Expand Down
4 changes: 2 additions & 2 deletions app/charts/bar/bars-stacked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export const BarsStacked = () => {
return {
key: getRenderingKey(observation, d.key),
y: yScale(getY(observation)) as number,
x: xScale(segment[1]),
x: xScale(segment[0]),
height: bandwidth,
width: Math.max(0, xScale(segment[0]) - xScale(segment[1])),
width: Math.min(0, xScale(segment[0]) - xScale(segment[1])) * -1,
color,
};
});
Expand Down

0 comments on commit 3757b40

Please sign in to comment.