From e27ed179056ae16bd04eb3eb7f5e07fa36c35a13 Mon Sep 17 00:00:00 2001 From: alexandre Date: Fri, 19 Apr 2024 13:54:50 +0200 Subject: [PATCH] [charts] Round y values for bar chart --- packages/x-charts/src/BarChart/BarElement.tsx | 1 - packages/x-charts/src/BarChart/BarPlot.tsx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/x-charts/src/BarChart/BarElement.tsx b/packages/x-charts/src/BarChart/BarElement.tsx index 1eeaef8c2135f..74c9249b8357f 100644 --- a/packages/x-charts/src/BarChart/BarElement.tsx +++ b/packages/x-charts/src/BarChart/BarElement.tsx @@ -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, diff --git a/packages/x-charts/src/BarChart/BarPlot.tsx b/packages/x-charts/src/BarChart/BarPlot.tsx index 627993b0931f9..ae62ce8877e8b 100644 --- a/packages/x-charts/src/BarChart/BarPlot.tsx +++ b/packages/x-charts/src/BarChart/BarPlot.tsx @@ -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,