From a5aa630b747904f6ecfced91ca88273b3670cf6c Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 12 Dec 2022 13:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Axis`=E7=9A=84`Value`?= =?UTF-8?q?=E8=BD=B4=E5=9C=A8=E6=9F=90=E4=BA=9B=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=95=B0=E5=80=BC=E8=8C=83=E5=9B=B4=E4=B8=8D?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Internal/Utilities/ChartHelper.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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) {