feat: 详情页K线改用 TradingView Lightweight Charts,蜡烛图原生支持

- 新增 KLineChart 组件(lightweight-charts v5):原生蜡烛图/折线切换、成交量副图(涨红跌绿)、自选日标记、双指缩放拖动
- 保留时间范围切换(3月/6月/1年,默认3月,一次性拉取365天前端切片)
- 修复 lightweight-charts 无法解析 CSS 变量/oklch 颜色的问题(改用固定 hex)
- 替换原 recharts K线(recharts Bar 自定义 shape 无法渲染蜡烛的问题彻底解决)
This commit is contained in:
Sakurasan
2026-08-28 11:15:48 +08:00
parent 24c8b31301
commit 25c179dc06
4 changed files with 231 additions and 148 deletions
+15
View File
@@ -125,6 +125,9 @@ importers:
input-otp:
specifier: ^1.4.2
version: 1.5.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
lightweight-charts:
specifier: ^5.2.1
version: 5.2.1
lucide-react:
specifier: ^0.575.0
version: 0.575.0(react@19.2.7)
@@ -1616,6 +1619,9 @@ packages:
eventemitter3@4.0.1:
resolution: {integrity: sha512-MnI0l35oYL2C/c80rjJN7qu50MDx39yYE7y7oYck2YA3v+y7EaAenY8IU8AP4d1RWqE8VAKWFGSh3rfP87ll3g==}
fancy-canvas@2.1.0:
resolution: {integrity: sha512-nifxXJ95JNLFR2NgRV4/MxVP45G9909wJTEKz5fg/TZS20JJZA6hfgRVh/bC9bwl2zBtBNcYPjiBE4njQHVBwQ==}
fast-equals@5.4.1:
resolution: {integrity: sha512-DjlFSM5Pk9cGcL0q5QXl66eGzx0N6szNgaswwc5ZphlBohjTVJSnGgI+rJVOgOi65qUoQnDZN4nDqi33udtydQ==}
engines: {node: '>=6.0.0'}
@@ -1767,6 +1773,9 @@ packages:
resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==}
engines: {node: '>= 12.0.0'}
lightweight-charts@5.2.1:
resolution: {integrity: sha512-IVwoK1RLFiLPubaKIjNbtjWLnpPMqiABSrTay6whmNa8L1+19292VtHJ+BWyPUuLCwF0tcQlhEWd1CLB2a1nsQ==}
lodash@4.18.1:
resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==}
@@ -3498,6 +3507,8 @@ snapshots:
eventemitter3@4.0.1: {}
fancy-canvas@2.1.0: {}
fast-equals@5.4.1: {}
fdir@6.5.0(picomatch@4.0.5):
@@ -3590,6 +3601,10 @@ snapshots:
lightningcss-win32-arm64-msvc: 1.32.0
lightningcss-win32-x64-msvc: 1.32.0
lightweight-charts@5.2.1:
dependencies:
fancy-canvas: 2.1.0
lodash@4.18.1: {}
loose-envify@1.4.0: