Files
sanguo_vnpy_v2/frontend
claude_dev 0c7b030773 fix(charts): 回测结果5图canvas宽度仅100px被压扁
根因: useChart 在 onMounted 调 echarts.init 时, 容器(在 el-tab-pane 内)尚未拿到
真实宽度 → canvas 用默认 100px; 且 setOption 后从不 resize, 数据异步到达后 canvas
仍停在初始窄宽 → 5 条曲线全被压成窄条。

修复(useChart 一处, 全部图表受益):
- setOption 后调 chart.resize() (数据到达时容器已布局, 同步真实宽度)
- 加 ResizeObserver 监听容器尺寸变化 (兼容 init 偏早 / tab 切换 / 窗口缩放)
- ensureChart() 懒初始化兜底

验证: canvas 宽 100→830px(满宽), 5 图横向铺满曲线正常
2026-07-11 23:16:05 +08:00
..

Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.