优化Serie的数据全为0时Y轴不显示的问题

This commit is contained in:
monitor1394
2021-08-03 08:23:02 +08:00
parent 65c3659c19
commit b6dd264b17
3 changed files with 4 additions and 2 deletions

View File

@@ -118,7 +118,8 @@ namespace XCharts
int split = GetSplitNumber(axis, coordinateWidth, dataZoom);
if (axis.type == Axis.AxisType.Value)
{
if (minValue == 0 && maxValue == 0) return string.Empty;
if (minValue == 0 && maxValue == 0)
maxValue = axis.max != 0 ? axis.max : 1;
double value = 0;
if (forcePercent) maxValue = 100;
if (axis.interval > 0)
@@ -396,7 +397,6 @@ namespace XCharts
{
if (!axis.show) return false;
if (axis.IsCategory() && axis.GetDataList().Count <= 0) return false;
else if (axis.IsValue() && axis.runtimeMinValue == 0 && axis.runtimeMaxValue == 0) return false;
else return true;
}