From 6b9291a4f939afe3f327c672485311b57530f88d Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Thu, 20 Nov 2025 15:44:57 +0800 Subject: [PATCH] update pay function --- src/views/DataBrowser/TradingViewChart.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/views/DataBrowser/TradingViewChart.tsx b/src/views/DataBrowser/TradingViewChart.tsx index a26b2cc9..336d0756 100644 --- a/src/views/DataBrowser/TradingViewChart.tsx +++ b/src/views/DataBrowser/TradingViewChart.tsx @@ -110,16 +110,27 @@ const TradingViewChart: React.FC = ({ timeVisible: true, secondsVisible: false, rightOffset: 12, - barSpacing: 3, + barSpacing: 6, // 增加条形间距,减少拥挤 fixLeftEdge: false, lockVisibleTimeRangeOnResize: true, rightBarStaysOnScroll: true, borderVisible: true, visible: true, + // 控制时间标签的最小间距(像素) + tickMarkMaxCharacterLength: 8, }, localization: { locale: 'zh-CN', - dateFormat: 'yyyy-MM-dd', + // 自定义时间格式化,根据时间范围智能显示 + timeFormatter: (time) => { + const date = new Date(time); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + + // 只显示年-月-日,简洁明了 + return `${year}-${month}-${day}`; + }, }, handleScroll: { mouseWheel: true,