mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
[improve][Axis] improve default split number
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
|
||||
### 日志详情
|
||||
|
||||
* (2022.09.26) 优化`Axis`在类目轴时的默认分割段数
|
||||
* (2022.09.25) 修复`API`文档中部分接口没有导出的问题
|
||||
* (2022.09.24) 优化`FunnelChart`
|
||||
* (2022.09.23) 优化`ParallelChart`
|
||||
|
||||
@@ -64,15 +64,10 @@ namespace XCharts.Runtime
|
||||
|
||||
if (axis.splitNumber <= 0)
|
||||
{
|
||||
if (dataCount <= 10) return dataCount;
|
||||
else
|
||||
{
|
||||
for (int i = 4; i < 6; i++)
|
||||
{
|
||||
if (dataCount % i == 0) return i;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
var eachWid = coordinateWid / dataCount;
|
||||
if (eachWid > 40) return dataCount;
|
||||
for (int i = 2; i < dataCount / 2; i++)
|
||||
if (eachWid * i > 40) return dataCount / i;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user