增加AxisMinMaxAuto范围类型

This commit is contained in:
monitor1394
2023-05-10 23:29:31 +08:00
parent 29c9f59762
commit fab683f5e1
8 changed files with 29 additions and 9 deletions

View File

@@ -692,8 +692,8 @@ namespace XCharts.Runtime
intvalue = (int)(max * Mathf.Pow(10, count));
}
var pow = Mathf.Pow(10, count);
var value = (max > 0) ? (int)((max * pow + 1)) / pow :
(int)((max * pow - 1)) / pow;
var value = max > 0 ? (int)((max * (pow + 1))) / pow :
(int)((max * (pow - 1))) / pow;
return GetMaxCeilRate(value, ceilRate);
}
if (ceilRate == 0)
@@ -757,8 +757,8 @@ namespace XCharts.Runtime
intvalue = (int)(min * Mathf.Pow(10, count));
}
var pow = Mathf.Pow(10, count);
var value = (min > 0) ? (int)((min * pow + 1)) / pow :
(int)((min * pow - 1)) / pow;
var value = min > 0 ? ((int)(min * (pow - 1))) / pow :
((int)(min * (pow + 1))) / pow;
return GetMinCeilRate(value, ceilRate);
}
if (ceilRate == 0)