Skip to content

Commit 769855d

Browse files
authored
[charts] Handle case where gradient stop offset could be Infinite (#16131)
1 parent e93f4d2 commit 769855d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/x-charts/src/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ type ChartsPiecewiseGradientProps = {
1313
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps) {
1414
const { isReversed, gradientId, size, direction, scale, colorMap } = props;
1515

16+
if (size <= 0) {
17+
return null;
18+
}
19+
1620
return (
1721
<linearGradient
1822
id={gradientId}

0 commit comments

Comments
 (0)