From 3a91dcc3cda3ede437e8ad0c0b23ce46640a581d Mon Sep 17 00:00:00 2001 From: Jayash Tripathy <76092296+JayashTripathy@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:45:33 +0530 Subject: [PATCH 1/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20add=20fill?= =?UTF-8?q?=20in=20barchart=20bar=20stroke?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/propel/src/charts/bar-chart/bar.tsx | 6 +++--- packages/propel/src/charts/bar-chart/root.tsx | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/propel/src/charts/bar-chart/bar.tsx b/packages/propel/src/charts/bar-chart/bar.tsx index 558e73ad603..d5b94bfe8f8 100644 --- a/packages/propel/src/charts/bar-chart/bar.tsx +++ b/packages/propel/src/charts/bar-chart/bar.tsx @@ -23,7 +23,7 @@ interface TShapeProps { } interface TBarProps extends TShapeProps { - fill: string | ((payload: any) => string); + fill: string; stackKeys: string[]; textClassName?: string; showPercentage?: boolean; @@ -108,7 +108,7 @@ const CustomBar = React.memo((props: TBarProps) => { {showText && ( @@ -130,7 +130,7 @@ const CustomBarLollipop = React.memo((props: TBarProps) => { y1={y + height} x2={x + width / 2} y2={y} - stroke={typeof fill === "function" ? fill(payload) : fill} + stroke={fill} strokeWidth={DEFAULT_LOLLIPOP_LINE_WIDTH} strokeLinecap="round" strokeDasharray={dotted ? "4 4" : "0"} diff --git a/packages/propel/src/charts/bar-chart/root.tsx b/packages/propel/src/charts/bar-chart/root.tsx index 23a21143219..a0ea10d3ccc 100644 --- a/packages/propel/src/charts/bar-chart/root.tsx +++ b/packages/propel/src/charts/bar-chart/root.tsx @@ -111,9 +111,10 @@ export const BarChart = React.memo((props: T className="[&_path]:transition-opacity [&_path]:duration-200" onMouseEnter={() => setActiveBar(bar.key)} onMouseLeave={() => setActiveBar(null)} + fill={getBarColor(data, bar.key)} /> )), - [activeLegend, stackKeys, bars] + [activeLegend, stackKeys, bars, getBarColor, data] ); return ( From 594e0959d935df088b199e34cb2803bb6a08ec97 Mon Sep 17 00:00:00 2001 From: Jayash Tripathy <76092296+JayashTripathy@users.noreply.github.com> Date: Thu, 11 Sep 2025 18:15:12 +0530 Subject: [PATCH 2/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20added=20fi?= =?UTF-8?q?ll=20in=20the=20circle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/propel/src/charts/bar-chart/bar.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/propel/src/charts/bar-chart/bar.tsx b/packages/propel/src/charts/bar-chart/bar.tsx index d5b94bfe8f8..55ddd7934b3 100644 --- a/packages/propel/src/charts/bar-chart/bar.tsx +++ b/packages/propel/src/charts/bar-chart/bar.tsx @@ -135,13 +135,7 @@ const CustomBarLollipop = React.memo((props: TBarProps) => { strokeLinecap="round" strokeDasharray={dotted ? "4 4" : "0"} /> - + {showPercentage && ( )}