diff --git a/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart b/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart index 6858d1ea..ed89f0af 100644 --- a/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart +++ b/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart @@ -179,7 +179,9 @@ class KlinePainter extends CustomPainter { // 绘制实体 final bodyTop = math.min(yOpen, yClose); final bodyBottom = math.max(yOpen, yClose); - final actualBodyBottom = bodyBottom - bodyTop < 1 ? bodyTop + 1 : bodyBottom; + // 最小实体高度:至少为蜡烛宽度的40%或3像素,避免 open≈close 时显示为横线"-" + final minBodyHeight = math.max(bodyWidth * 0.4, 3.0); + final actualBodyBottom = bodyBottom - bodyTop < minBodyHeight ? bodyTop + minBodyHeight : bodyBottom; if (isUp) { // 阳线:空心或实心