修复Covert XY Axis后Y轴的Label显示异常的问题

This commit is contained in:
monitor1394
2022-12-22 22:15:58 +08:00
parent d7cfda2521
commit d9053db2e3
2 changed files with 4 additions and 2 deletions

View File

@@ -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`设置为固定值时显示不正常的问题

View File

@@ -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