From 80fe74c04149e1ed47f557fb81426e3cb4452ba6 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Thu, 20 Nov 2025 14:13:33 +0800 Subject: [PATCH] update pay function --- src/views/DataBrowser/TradingViewChart.tsx | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/views/DataBrowser/TradingViewChart.tsx b/src/views/DataBrowser/TradingViewChart.tsx index 33b49185..9a9585bd 100644 --- a/src/views/DataBrowser/TradingViewChart.tsx +++ b/src/views/DataBrowser/TradingViewChart.tsx @@ -70,26 +70,23 @@ const TradingViewChart: React.FC = ({ useEffect(() => { if (!chartContainerRef.current || data.length === 0) return; - // 创建图表 + // 创建图表 (lightweight-charts 5.0 标准 API) const chart = createChart(chartContainerRef.current, { width: chartContainerRef.current.clientWidth, height: 500, layout: { - background: { color: themeColors.bg.card }, + background: { type: 'solid', color: themeColors.bg.card }, textColor: themeColors.text.secondary, }, grid: { vertLines: { color: 'rgba(255, 255, 255, 0.05)', - style: 1, // 实线 }, horzLines: { color: 'rgba(255, 255, 255, 0.05)', - style: 1, }, }, crosshair: { - mode: 1, // 正常十字线模式 vertLine: { color: themeColors.primary.gold, width: 1, @@ -105,26 +102,15 @@ const TradingViewChart: React.FC = ({ }, rightPriceScale: { borderColor: themeColors.border.default, - scaleMargins: { - top: 0.1, - bottom: 0.1, - }, }, timeScale: { borderColor: themeColors.border.default, timeVisible: true, secondsVisible: false, - rightOffset: 5, - barSpacing: 10, - minBarSpacing: 3, - fixLeftEdge: true, - fixRightEdge: true, }, handleScroll: { mouseWheel: true, pressedMouseMove: true, - horzTouchDrag: true, - vertTouchDrag: true, }, handleScale: { axisPressedMouseMove: true, @@ -133,11 +119,10 @@ const TradingViewChart: React.FC = ({ }, }); - // 创建折线系列 + // 创建折线系列 (lightweight-charts 5.0 标准 API) const lineSeries = chart.addLineSeries({ color: themeColors.primary.gold, lineWidth: 2, - lineStyle: 0, // 实线 crosshairMarkerVisible: true, crosshairMarkerRadius: 6, crosshairMarkerBorderColor: themeColors.primary.goldLight,