Skip to content

Commit

Permalink
[charts] Round y values for bar chart (mui#12846)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored and thomasmoon committed Sep 6, 2024
1 parent 630f7d8 commit df9c9e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/x-charts/src/BarChart/BarElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const BarElementPath = styled(animated.rect, {
overridesResolver: (_, styles) => styles.root,
})<{ ownerState: BarElementOwnerState }>(({ ownerState }) => ({
stroke: 'none',
shapeRendering: 'crispEdges',
fill: ownerState.isHighlighted
? d3Color(ownerState.color)!.brighter(0.5).formatHex()
: ownerState.color,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/BarChart/BarPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ const useAggregatedData = (): CompletedBarData[] => {
return stackedData.map((values, dataIndex: number) => {
const valueCoordinates = values.map((v) => (verticalLayout ? yScale(v)! : xScale(v)!));

const minValueCoord = Math.min(...valueCoordinates);
const maxValueCoord = Math.max(...valueCoordinates);
const minValueCoord = Math.round(Math.min(...valueCoordinates));
const maxValueCoord = Math.round(Math.max(...valueCoordinates));

return {
seriesId,
Expand Down

0 comments on commit df9c9e6

Please sign in to comment.