diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 625ae1c7..f89fac30 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -65,6 +65,7 @@ slug: /changelog ## master +* (2022.12.12) 修复`Axis`的`Value`轴在某些情况下计算数值范围不准确的问题 * (2022.12.12) 优化`Legend`的`formatter`支持`{h}`通配符 * (2022.12.12) 修复`Legend`的`formatter`设置为固定值时显示不正常的问题 * (2022.12.08) 增加`AreaStyle`的`toTop`参数可设置折线图渐变色是到顶部还是到实际位置 diff --git a/Runtime/Internal/Utilities/ChartHelper.cs b/Runtime/Internal/Utilities/ChartHelper.cs index cc76d08a..2b8a88f8 100644 --- a/Runtime/Internal/Utilities/ChartHelper.cs +++ b/Runtime/Internal/Utilities/ChartHelper.cs @@ -713,7 +713,7 @@ namespace XCharts.Runtime } if (ceilRate == 0) { - var bigger = Math.Floor(Math.Abs(min)); + var bigger = min < 0 ? Math.Ceiling(Math.Abs(min)) : Math.Floor(Math.Abs(min)); int n = 1; while (bigger / (Mathf.Pow(10, n)) > 10) {