mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 01:40:06 +00:00
优化Serie的数据全为0时Y轴不显示的问题
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2021.08.03) Fixed y axis not displaying when all data is 0
|
||||||
* (2021.07.29) Fixed ignored data will also participate in calculations when `ignore` is enabled (#161)
|
* (2021.07.29) Fixed ignored data will also participate in calculations when `ignore` is enabled (#161)
|
||||||
* (2021.07.29) Improved `BarChart`'s `Zebra` gradient support
|
* (2021.07.29) Improved `BarChart`'s `Zebra` gradient support
|
||||||
* (2021.07.26) Fixed issue where `XCharts` path could not be found when `TextMeshPro Enable` (#160)
|
* (2021.07.26) Fixed issue where `XCharts` path could not be found when `TextMeshPro Enable` (#160)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2021.08.03) 优化`Serie`的数据全为0时Y轴不显示的问题
|
||||||
* (2021.07.29) 修复`Serie`开启`ignore`时被忽略的数据还会参与计算的问题 (#161)
|
* (2021.07.29) 修复`Serie`开启`ignore`时被忽略的数据还会参与计算的问题 (#161)
|
||||||
* (2021.07.29) 完善`BarChart`的`Zebra`斑马柱图渐变支持
|
* (2021.07.29) 完善`BarChart`的`Zebra`斑马柱图渐变支持
|
||||||
* (2021.07.26) 修复`TextMeshPro Enable`时找不到`XCharts`路径的问题 (#160)
|
* (2021.07.26) 修复`TextMeshPro Enable`时找不到`XCharts`路径的问题 (#160)
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ namespace XCharts
|
|||||||
int split = GetSplitNumber(axis, coordinateWidth, dataZoom);
|
int split = GetSplitNumber(axis, coordinateWidth, dataZoom);
|
||||||
if (axis.type == Axis.AxisType.Value)
|
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;
|
double value = 0;
|
||||||
if (forcePercent) maxValue = 100;
|
if (forcePercent) maxValue = 100;
|
||||||
if (axis.interval > 0)
|
if (axis.interval > 0)
|
||||||
@@ -396,7 +397,6 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
if (!axis.show) return false;
|
if (!axis.show) return false;
|
||||||
if (axis.IsCategory() && axis.GetDataList().Count <= 0) 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;
|
else return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user