From d9053db2e38eb260c252fe1d26eda94a81fb681f Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 22 Dec 2022 22:15:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Covert=20XY=20Axis`=E5=90=8E?= =?UTF-8?q?Y=E8=BD=B4=E7=9A=84`Label`=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=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/Component/Axis/AxisHelper.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index f89fac30..20a467e2 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -65,6 +65,7 @@ slug: /changelog ## master +* (2022.12.22) 修复`Covert XY Axis`后Y轴的`Label`显示异常的问题 * (2022.12.12) 修复`Axis`的`Value`轴在某些情况下计算数值范围不准确的问题 * (2022.12.12) 优化`Legend`的`formatter`支持`{h}`通配符 * (2022.12.12) 修复`Legend`的`formatter`设置为固定值时显示不正常的问题 diff --git a/Runtime/Component/Axis/AxisHelper.cs b/Runtime/Component/Axis/AxisHelper.cs index ea78584a..a5ec4df7 100644 --- a/Runtime/Component/Axis/AxisHelper.cs +++ b/Runtime/Component/Axis/AxisHelper.cs @@ -65,8 +65,9 @@ namespace XCharts.Runtime if (axis.splitNumber <= 0) { var eachWid = coordinateWid / dataCount; - if (eachWid > 80) return dataCount; - var tick = Mathf.CeilToInt(80 / eachWid); + var min = axis is YAxis ? 20 : 80; + if (eachWid > min) return dataCount; + var tick = Mathf.CeilToInt(min / eachWid); return (int) (dataCount / tick); } else