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(() => { useEffect(() => {
if (!chartContainerRef.current || data.length === 0) return; if (!chartContainerRef.current || data.length === 0) return;
// 创建图表 // 创建图表 (lightweight-charts 5.0 标准 API)
const chart = createChart(chartContainerRef.current, { const chart = createChart(chartContainerRef.current, {
width: chartContainerRef.current.clientWidth, width: chartContainerRef.current.clientWidth,
height: 500, height: 500,
layout: { layout: {
background: { color: themeColors.bg.card }, background: { type: 'solid', color: themeColors.bg.card },
textColor: themeColors.text.secondary, textColor: themeColors.text.secondary,
}, },
grid: { grid: {
vertLines: { vertLines: {
color: 'rgba(255, 255, 255, 0.05)', color: 'rgba(255, 255, 255, 0.05)',
style: 1, // 实线
}, },
horzLines: { horzLines: {
color: 'rgba(255, 255, 255, 0.05)', color: 'rgba(255, 255, 255, 0.05)',
style: 1,
}, },
}, },
crosshair: { crosshair: {
mode: 1, // 正常十字线模式
vertLine: { vertLine: {
color: themeColors.primary.gold, color: themeColors.primary.gold,
width: 1, width: 1,
@@ -105,26 +102,15 @@ const TradingViewChart: React.FC<TradingViewChartProps> = ({
}, },
rightPriceScale: { rightPriceScale: {
borderColor: themeColors.border.default, borderColor: themeColors.border.default,
scaleMargins: {
top: 0.1,
bottom: 0.1,
},
}, },
timeScale: { timeScale: {
borderColor: themeColors.border.default, borderColor: themeColors.border.default,
timeVisible: true, timeVisible: true,
secondsVisible: false, secondsVisible: false,
rightOffset: 5,
barSpacing: 10,
minBarSpacing: 3,
fixLeftEdge: true,
fixRightEdge: true,
}, },
handleScroll: { handleScroll: {
mouseWheel: true, mouseWheel: true,
pressedMouseMove: true, pressedMouseMove: true,
horzTouchDrag: true,
vertTouchDrag: true,
}, },
handleScale: { handleScale: {
axisPressedMouseMove: true, axisPressedMouseMove: true,
@@ -133,11 +119,10 @@ const TradingViewChart: React.FC<TradingViewChartProps> = ({
}, },
}); });
// 创建折线系列 // 创建折线系列 (lightweight-charts 5.0 标准 API)
const lineSeries = chart.addLineSeries({ const lineSeries = chart.addLineSeries({
color: themeColors.primary.gold, color: themeColors.primary.gold,
lineWidth: 2, lineWidth: 2,
lineStyle: 0, // 实线
crosshairMarkerVisible: true, crosshairMarkerVisible: true,
crosshairMarkerRadius: 6, crosshairMarkerRadius: 6,
crosshairMarkerBorderColor: themeColors.primary.goldLight, crosshairMarkerBorderColor: themeColors.primary.goldLight,