From 34b409648269703c1a0327c9aa2ead226489cca7 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 30 Jan 2024 23:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAttempted=20to=20divide=20by?= =?UTF-8?q?=20zero=E6=8A=A5=E9=94=99=20#302?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Component/Axis/AxisHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Component/Axis/AxisHelper.cs b/Runtime/Component/Axis/AxisHelper.cs index e747ff81..42230ca7 100644 --- a/Runtime/Component/Axis/AxisHelper.cs +++ b/Runtime/Component/Axis/AxisHelper.cs @@ -68,7 +68,7 @@ namespace XCharts.Runtime var min = axis is YAxis ? 20 : 80; if (eachWid > min) return dataCount; var tick = Mathf.CeilToInt(min / eachWid); - return (int)(dataCount / tick); + return tick <= 1 ? dataCount : (int)(dataCount / tick); } else {