From 769855d8c24442449eeda3844399c410f678dd13 Mon Sep 17 00:00:00 2001 From: Jose C Quintas Jr Date: Sat, 11 Jan 2025 10:54:03 +0100 Subject: [PATCH] [charts] Handle case where gradient stop `offset` could be `Infinite` (#16131) --- .../ChartsAxesGradients/ChartsPiecewiseGradient.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/x-charts/src/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.tsx b/packages/x-charts/src/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.tsx index cd792c6c72d53..3beb57335c92a 100644 --- a/packages/x-charts/src/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.tsx +++ b/packages/x-charts/src/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.tsx @@ -13,6 +13,10 @@ type ChartsPiecewiseGradientProps = { export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps) { const { isReversed, gradientId, size, direction, scale, colorMap } = props; + if (size <= 0) { + return null; + } + return (