Commit Graph

17 Commits

Author SHA1 Message Date
hailin 99c1ff1fb7 fix(kline): convert time to local timezone for display
- Added toLocal() conversion in _formatTimeLabel (painter)
- Added toLocal() conversion in _formatDateTime (widget)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:55:56 -08:00
hailin 900ba4a555 feat(kline): add dynamic X-axis time labels
- Added _drawTimeAxis method to render time labels
- Labels dynamically adjust spacing based on candleWidth
- Shows HH:MM format, or M/D for midnight
- Labels follow pan/zoom movements
- Increased bottomPadding to 20px for label space

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:51:23 -08:00
hailin 453cab71e4 chore: remove debug logging from kline pan
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:49:34 -08:00
hailin f55fb13f26 feat(kline): implement true pan effect with scrollOffset
- Added scrollOffset parameter to KlinePainter and KlineVolumePainter
- Painters now draw all klines and apply scrollOffset for positioning
- Added canvas clipping to prevent drawing outside chart bounds
- Removed _getVisibleData and related helper methods (no longer needed)
- scrollOffset directly controls the visual position of all klines

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:43:45 -08:00
hailin 48ba72ce89 fix(kline): simplify pan logic - scrollX now always controls view position
- Removed _userHasPanned flag and special handling
- _scrollX is initialized in _scrollToCenter() at startup
- Pan gesture directly modifies _scrollX
- _getVisibleData() always uses _scrollX to calculate visible range

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:35:31 -08:00
hailin 7ae58e98e6 debug: 添加平移调试信息 2026-01-19 21:30:41 -08:00
hailin 684367941d feat(kline): 支持左右平移查看历史K线
- 初始状态:最新K线在屏幕中心(保持原有逻辑不变)
- 用户平移后可查看全部历史数据
- 切换周期时重置平移状态

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:25:59 -08:00
hailin f149c2a06a fix(kline): 数据量大时只取最近数据,让最新K线在屏幕中心
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:39:33 -08:00
hailin a15ab7600f fix(kline): 修正K线显示逻辑,从左开始排列,最新K线居中
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:26:20 -08:00
hailin f51aa44cd9 feat(frontend): K线图组件支持深色模式
- kline_chart_widget.dart: 使用 AppColors 动态颜色,传递 isDark 参数
- kline_painter.dart: 添加 isDark 参数,网格/文字/十字线颜色随主题变化
- kline_volume_painter.dart: 添加 isDark 参数,成交量图颜色随主题变化

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 19:42:52 -08:00
hailin d815792deb feat(kline): 默认隐藏MA均线指标
- 将主图指标默认值从 0(MA) 改为 -1(无)
- 首次加载K线图时不再显示 MA5/MA10/MA20/MA60 均线
- 保留指标切换功能,用户可手动开启 MA/EMA/BOLL 指标
- 使K线图界面更简洁清爽

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 18:05:30 -08:00
hailin a97e0b51b8 feat(kline): 首次加载时让最新K线居中显示
- 新增 _scrollToCenter() 方法,计算让最新K线居中的滚动位置
- 初始化时调用 _scrollToCenter() 替代 _scrollToEnd()
- 如果K线总宽度小于屏幕宽度,不滚动,从左开始显示
- 保留 _scrollToEnd() 方法供刷新按钮等场景使用

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 18:03:23 -08:00
hailin 928d6c8df2 refactor(frontend): 优化K线图显示与交互体验
主要改动:
1. 隐藏技术指标 - 暂时隐藏MA/EMA/BOLL主图指标和MACD/KDJ/RSI副图指标
   - 保留全部代码,便于未来恢复(取消注释即可)
   - 调整高度分配:主图75%、成交量25%

2. 修复单指滑动(pan)问题
   - 移除错误的scale阈值检测 `(details.scale - 1.0).abs() > 0.01`
   - 改用 `pointerCount > 1` 区分单指滑动和双指缩放
   - 单指滑动现可正常左右拖动K线图

3. 优化首次加载显示
   - 新增 `_initialized` 标志控制初始化时机
   - 新增 `_initializeCandleWidth()` 方法动态计算K线宽度
   - K线首次加载时自动填满可视区域宽度
   - 数据量变化时自动重新初始化

技术细节:
- 使用 LayoutBuilder 获取实际图表宽度后再初始化
- 通过 postFrameCallback 确保在布局完成后执行初始化
- K线宽度限制在 3.0-30.0 像素范围内

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:31:24 -08:00
hailin 2154d5752f fix: 修复K线图NaN错误并添加mining-service划转端点
- 修复K线图当价格范围为0时导致的NaN Offset错误
- 在mining-service添加transfer-out和transfer-in端点
- 划转操作会在mining_transactions表中记录明细

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 07:12:32 -08:00
hailin d5e5bf642c fix(kline-chart): prevent overflow in indicator selector and legend
- Wrap indicator selector Row in SingleChildScrollView for horizontal scrolling
- Add maxX boundary checks in _drawLegend to stop drawing when exceeding available space
- Prevents text overflow on narrow screens or when displaying many indicators

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 09:55:49 -08:00
hailin 27bf67e561 fix(kline-chart): improve pinch-to-zoom and fullscreen display
- Refactor to pixel-based scrolling system for smoother interaction
- Fix pinch-to-zoom to properly scale around focal point
- Adjust fullscreen layout to give more space to main chart (65%)
- Add candleWidth parameter to all painters for consistent rendering
- Detect multi-touch gestures using pointerCount

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 09:49:14 -08:00
hailin 20a90fce4c feat(mining-app): add professional kline chart with technical indicators
- Add KlineChartWidget with pinch-to-zoom, fullscreen mode
- Implement MA, EMA, BOLL indicators for main chart
- Implement MACD, KDJ, RSI indicators for sub chart
- Add volume display with crossline info
- Add C2C trading feature with market/publish/detail pages
- Add P2P transfer functionality (send/receive shares)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:51:00 -08:00