update pay function

This commit is contained in:
2025-11-20 14:13:33 +08:00
parent 78f7dca1f6
commit 80fe74c041

View File

@@ -70,26 +70,23 @@ const TradingViewChart: React.FC<TradingViewChartProps> = ({
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<TradingViewChartProps> = ({
},
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<TradingViewChartProps> = ({
},
});
// 创建折线系列
// 创建折线系列 (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,