From 2d35f7774003da5290259750e77e588be91abfaf Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 4 May 2023 13:25:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`AxisLabel`=E5=9C=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=83=BD=E6=98=AF=E5=B0=8F=E4=BA=8E1=E7=9A=84?= =?UTF-8?q?=E6=B5=AE=E7=82=B9=E6=95=B0=E6=97=B6=E6=98=BE=E7=A4=BA`Label`?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=B8=8D=E5=AF=B9=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/MathUtil.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 3529010b..cf53c481 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -66,6 +66,7 @@ slug: /changelog ## master +* (2023.05.04) 修复`AxisLabel`在数据都是小于1的浮点数时显示`Label`格式不对的问题 * (2023.05.04) 修复`Theme`在修改默认主题的参数后运行被重置的问题 * (2023.05.04) 增加`Symbol`选择`Custom`类型时的`Warning`提示 * (2023.04.15) 修复`DataZoom`在多个图表时可能异常的问题 (#252) diff --git a/Runtime/Internal/Utilities/MathUtil.cs b/Runtime/Internal/Utilities/MathUtil.cs index 443d3f97..fed7cfbe 100644 --- a/Runtime/Internal/Utilities/MathUtil.cs +++ b/Runtime/Internal/Utilities/MathUtil.cs @@ -39,6 +39,8 @@ namespace XCharts.Runtime public static bool IsInteger(double value) { + if (value == 0) return true; + if (value >= -1 && value <= 1) return false; return Math.Abs(value % 1) <= (Double.Epsilon * 100); }