From 5753ea31bc2bbe7d3648d7331e649a6a5ff97ade Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 21 Aug 2024 15:53:12 +0200 Subject: [PATCH] [charts] Fix grid overflow with zooming --- packages/x-charts/src/ChartsGrid/ChartsGrid.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/x-charts/src/ChartsGrid/ChartsGrid.tsx b/packages/x-charts/src/ChartsGrid/ChartsGrid.tsx index c150244b2d39b..19b880e70ed09 100644 --- a/packages/x-charts/src/ChartsGrid/ChartsGrid.tsx +++ b/packages/x-charts/src/ChartsGrid/ChartsGrid.tsx @@ -10,6 +10,7 @@ import { getChartsGridUtilityClass, chartsGridClasses, } from './chartsGridClasses'; +import { useDrawingArea } from '../hooks/useDrawingArea'; const GridRoot = styled('g', { name: 'MuiChartsGrid', @@ -68,6 +69,7 @@ export interface ChartsGridProps { function ChartsGrid(props: ChartsGridProps) { const themeProps = useThemeProps({ props, name: 'MuiChartsGrid' }); + const drawingArea = useDrawingArea(); const { vertical, horizontal, ...other } = themeProps; const { xAxis, xAxisIds, yAxis, yAxisIds } = useCartesianContext(); @@ -97,8 +99,8 @@ function ChartsGrid(props: ChartsGridProps) { xTicks.map(({ formattedValue, offset }) => ( ))}