From bbf0adf31a1f08f3ca09b709efd1daa15cb8498c Mon Sep 17 00:00:00 2001 From: Sergio Date: Tue, 10 Mar 2026 12:01:53 -0700 Subject: [PATCH] fix(stock-price): align sparkline color with displayed price change (#5181) --- packages/widgets/src/stocks/component.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/widgets/src/stocks/component.tsx b/packages/widgets/src/stocks/component.tsx index 8cfc58b07..e9d7b98ad 100644 --- a/packages/widgets/src/stocks/component.tsx +++ b/packages/widgets/src/stocks/component.tsx @@ -33,6 +33,7 @@ export default function StockPriceWidget({ options, width, height }: WidgetCompo const stockValuesMin = Math.min(...data.priceHistory); const stockGraphValues = data.priceHistory.map((value) => value - stockValuesMin + 50); + const trendColor = stockValuesChange > 0 ? "green.7" : stockValuesChange < 0 ? "red.7" : "gray.6"; return ( @@ -43,7 +44,7 @@ export default function StockPriceWidget({ options, width, height }: WidgetCompo h={height > 280 ? "75%" : "50%"} data={stockGraphValues} curveType="linear" - trendColors={{ positive: "green.7", negative: "red.7", neutral: "gray.6" }} + color={trendColor} fillOpacity={0.6} strokeWidth={2.5} />