增加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

@@ -59,7 +59,12 @@ namespace XCharts.Runtime
/// Customize the minimum and maximum.
/// |自定义最小值最大值。
/// </summary>
Custom
Custom,
/// <summary>
/// [since("v3.7.0")]minimum - maximum, automatically calculate the appropriate values.
/// |[since("v3.7.0")]最小值-最大值。自动计算合适的值。
/// </summary>
MinMaxAuto,
}
/// <summary>
/// the position of axis in grid.

View File

@@ -393,7 +393,14 @@ namespace XCharts.Runtime
break;
case Axis.AxisMinMaxType.MinMax:
if (ceilRate != 0)
{
minValue = ChartHelper.GetMinCeilRate(minValue, ceilRate);
maxValue = ChartHelper.GetMaxCeilRate(maxValue, ceilRate);
}
break;
case Axis.AxisMinMaxType.MinMaxAuto:
minValue = needFormat ? ChartHelper.GetMinDivisibleValue(minValue, ceilRate) : minValue;
maxValue = needFormat ? ChartHelper.GetMaxDivisibleValue(maxValue, ceilRate) : maxValue;
break;