From 6e6ec6cb03d99871ed66dd5a9a700aee622c6058 Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Tue, 24 Feb 2026 00:18:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E4=B9=B0=E5=85=A5?= =?UTF-8?q?=E5=8D=96=E5=87=BA=E6=8A=98=E7=BA=BF=E5=9B=BE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/FundTrendChart.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/components/FundTrendChart.jsx b/app/components/FundTrendChart.jsx index 4be4ac2..1072d87 100644 --- a/app/components/FundTrendChart.jsx +++ b/app/components/FundTrendChart.jsx @@ -139,7 +139,8 @@ export default function FundTrendChart({ code, isExpanded, onToggleExpand, trans type: 'line', // Use line type with showLine: false to simulate scatter on Category scale label: '买入', data: buyPoints, - borderColor: '#ef4444', // Red + borderColor: '#ffffff', + borderWidth: 1, backgroundColor: '#ef4444', pointStyle: 'circle', pointRadius: 2.5, @@ -151,7 +152,8 @@ export default function FundTrendChart({ code, isExpanded, onToggleExpand, trans type: 'line', label: '卖出', data: sellPoints, - borderColor: '#22c55e', // Green + borderColor: '#ffffff', + borderWidth: 1, backgroundColor: '#22c55e', pointStyle: 'circle', pointRadius: 2.5, @@ -243,11 +245,11 @@ export default function FundTrendChart({ code, isExpanded, onToggleExpand, trans const labelWidth = ctx.measureText(text).width + 12; // Draw label above the point - ctx.globalAlpha = 0.8; + ctx.globalAlpha = 0.7; ctx.fillStyle = bgColor; ctx.fillRect(x - labelWidth/2, y - 24, labelWidth, 18); - ctx.globalAlpha = 1.0; + ctx.globalAlpha = 0.7; ctx.fillStyle = textColor; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; @@ -272,7 +274,7 @@ export default function FundTrendChart({ code, isExpanded, onToggleExpand, trans if (datasets[2] && datasets[2].data) { const firstSellIndex = datasets[2].data.findIndex(v => v !== null && v !== undefined); if (firstSellIndex !== -1) { - drawPointLabel(2, firstSellIndex, '卖出', primaryColor); + drawPointLabel(2, firstSellIndex, '卖出', '#22c55e'); } } @@ -355,8 +357,8 @@ export default function FundTrendChart({ code, isExpanded, onToggleExpand, trans if (dsIndex > 0 && datasets[dsIndex]) { const label = datasets[dsIndex].label; // Determine background color based on dataset index - // 1 = Buy (Red), 2 = Sell (Theme Color) - const bgColor = dsIndex === 1 ? '#ef4444' : primaryColor; + // 1 = Buy (Red), 2 = Sell (Green) + const bgColor = dsIndex === 1 ? '#ef4444' : '#22c55e'; // If collision, offset Buy label upwards let yOffset = 0;