3.0 - optimize code

This commit is contained in:
monitor1394
2022-03-04 22:17:32 +08:00
parent 1ee0df09eb
commit 5745fea9a1
59 changed files with 482 additions and 435 deletions

View File

@@ -81,6 +81,8 @@ namespace XCharts.Runtime
{
if (dataCount < 1)
dataCount = 1;
if (axis.IsValue())
return dataCount > 1 ? coordinateWidth / (dataCount - 1) : coordinateWidth;
var categoryCount = axis.GetDataCount(dataZoom);
int segment = (axis.boundaryGap ? categoryCount : categoryCount - 1);
segment = segment <= 0 ? dataCount : segment;