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); }