This commit is contained in:
wyf
2025-08-15 10:16:35 +08:00
parent b2fd885192
commit 7cffe978ae
11 changed files with 253 additions and 197 deletions

View File

@@ -21,8 +21,13 @@ class ScatterPlotChart extends StatelessWidget {
@override
Widget build(BuildContext context) {
// 计算向上取整后的最大值
double xMaxCeil = (xMax / 100).ceil() * 100.0;
double yMaxCeil = (yMax / 100).ceil() * 100.0;
// double xMaxCeil = (xMax / divisions).ceil() * divisions.toDouble();
double temp = (xMax / divisions).ceil().toDouble(); // 计算向上取整后的每个分区的最大值
double xMaxCeil = (((temp / 100).ceil()) * 100 * (divisions - 1))
.toDouble(); // 向百取整并乘以 divisions
double tempy = (yMax / divisions).ceil().toDouble(); // 计算向上取整后的每个分区的最大值
double yMaxCeil =
(((tempy / 100).ceil()) * 100 * (divisions - 1)).toDouble();
return SizedBox(
child: ScatterChart(
@@ -62,7 +67,7 @@ class ScatterPlotChart extends StatelessWidget {
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.right, // 右对齐
textAlign: TextAlign.center, // 右对齐
),
);
},
@@ -78,6 +83,9 @@ class ScatterPlotChart extends StatelessWidget {
fontSize: 18.rpx,
color: themeController.currentColor.sc4,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center, // 右对齐
);
},
),