From c9c8352cef626aef72aef9ff38585ea99b07c2e6 Mon Sep 17 00:00:00 2001 From: Aditya Pandey Date: Sun, 15 Sep 2024 20:18:03 +0530 Subject: [PATCH] fixes a bug --- .../chart-elements/AreaChart/AreaChart.tsx | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 5390f95cb..eaf792801 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -291,23 +291,24 @@ const AreaChart = React.forwardRef((props, ref) } /> ) : null} - {categories.map((category) => { - return ( - - {showGradient ? ( - + {categories.map((category) => { + const gradientId = (categoryColors.get(category) ?? BaseColors.Gray).replace('#', ''); + return ( + + {showGradient ? ( + ((props, ref) ) : ( ((props, ref) ); })} - {categories.map((category) => ( + {categories.map((category) => { + const gradientId = (categoryColors.get(category) ?? BaseColors.Gray).replace('#', ''); ((props, ref) colorPalette.text, ).strokeColor } + fill={`url(#${gradientId})`} strokeOpacity={activeDot || (activeLegend && activeLegend !== category) ? 0.3 : 1} activeDot={(props: any) => { const { cx, cy, stroke, strokeLinecap, strokeLinejoin, strokeWidth, dataKey } = @@ -466,4 +469,4 @@ const AreaChart = React.forwardRef((props, ref) AreaChart.displayName = "AreaChart"; -export default AreaChart; +export default AreaChart; \ No newline at end of file