diff --git a/src/components/StockChart/KLineChartModal.tsx b/src/components/StockChart/KLineChartModal.tsx index c303d517..07409313 100644 --- a/src/components/StockChart/KLineChartModal.tsx +++ b/src/components/StockChart/KLineChartModal.tsx @@ -705,7 +705,7 @@ const KLineChartModal: React.FC = ({ )} -
+
{loading && (
= ({ 加载K线数据...
)} -
+ {/* 使用 aspect-ratio 保持图表宽高比,K线图推荐 2.5:1 */} +
diff --git a/src/components/StockChart/StockChartKLineModal.tsx b/src/components/StockChart/StockChartKLineModal.tsx index de9f7d7f..745d0a54 100644 --- a/src/components/StockChart/StockChartKLineModal.tsx +++ b/src/components/StockChart/StockChartKLineModal.tsx @@ -251,7 +251,8 @@ const StockChartKLineModal: React.FC = ({ id={`kline-chart-${stock.stock_code}`} style={{ width: '100%', - height: `${CHART_HEIGHTS.main}px`, + minHeight: '300px', + height: 'min(400px, 60vh)', opacity: showLoading ? 0.5 : 1, transition: 'opacity 0.3s', }} diff --git a/src/components/StockChart/TimelineChartModal.tsx b/src/components/StockChart/TimelineChartModal.tsx index eb9eb809..66668e8c 100644 --- a/src/components/StockChart/TimelineChartModal.tsx +++ b/src/components/StockChart/TimelineChartModal.tsx @@ -470,12 +470,13 @@ const TimelineChartModal: React.FC = ({ @@ -498,7 +499,7 @@ const TimelineChartModal: React.FC = ({ )} - + {loading && ( = ({ )} -
+ {/* 使用 aspect-ratio 保持图表宽高比,与日K线保持一致 */} +