mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
[fix] fix divide by zero exception
This commit is contained in:
@@ -59,6 +59,8 @@
|
||||
|
||||
## master
|
||||
|
||||
* (2022.09.30) 修复`Chart`在很小尺寸时出现`DivideByZeroException`异常
|
||||
|
||||
## v3.3.0
|
||||
|
||||
### 版本要点
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace XCharts.Runtime
|
||||
else
|
||||
{
|
||||
var data = axis.GetDataList(dataZoom);
|
||||
if (axis.IsCategory() && data.Count > 0)
|
||||
if (axis.IsCategory() && data.Count > 0 && splitNum > 0)
|
||||
{
|
||||
var count = axis.boundaryGap ? data.Count : data.Count - 1;
|
||||
int tick = count / splitNum;
|
||||
|
||||
Reference in New Issue
Block a user