diff --git a/CHANGELOG-EN.md b/CHANGELOG-EN.md index a6f0bb51..ed8142e2 100644 --- a/CHANGELOG-EN.md +++ b/CHANGELOG-EN.md @@ -41,6 +41,7 @@ ## branch-2.0 +* (2021.12.08) Fixed y axis does not refresh when serie hidden * (2021.12.04) Added `Symbol` new types: `EmptyRect`, `EmptyTriangle`, `EmptyDiamond` * (2021.12.04) Added setting symbol empty area color by itemStyle's backgroundColor * (2021.12.03) Fixed formatter `{c}` not work #175 diff --git a/CHANGELOG.md b/CHANGELOG.md index 843cd95f..67c4578a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ ## branch-2.0 +* (2021.12.08) 修复`Serie`隐藏后`Y`轴最大值不刷新的问题 * (2021.12.04) 增加`Symbol`新类型:`EmptyRect`,`EmptyTriangle`,`EmptyDiamond` * (2021.12.04) 增加`Symbol`的`Empty`区域颜色可通过`ItemStyle`的`backgroundColor`设置的支持 * (2021.12.03) 修复`Formatter`的`{c}`通配符不生效的问题 #175 diff --git a/Runtime/Helper/SeriesHelper.cs b/Runtime/Helper/SeriesHelper.cs index 05993447..98953e31 100644 --- a/Runtime/Helper/SeriesHelper.cs +++ b/Runtime/Helper/SeriesHelper.cs @@ -443,7 +443,8 @@ namespace XCharts { var serie = series.GetSerie(i); if ((isPolar && serie.polarIndex != axisIndex) - || (!isPolar && serie.yAxisIndex != axisIndex)) continue; + || (!isPolar && serie.yAxisIndex != axisIndex) + || !series.IsActive(i)) continue; if (isPercentStack && SeriesHelper.IsPercentStack(series, serie.name, SerieType.Bar)) { if (100 > max) max = 100; @@ -485,7 +486,8 @@ namespace XCharts { var serie = ss.Value[i]; if ((isPolar && serie.polarIndex != axisIndex) - || (!isPolar && serie.yAxisIndex != axisIndex)) continue; + || (!isPolar && serie.yAxisIndex != axisIndex) + || !series.IsActive(i)) continue; var showData = serie.GetDataList(dataZoom); if (SeriesHelper.IsPercentStack(series, serie.stack, SerieType.Bar)) { @@ -510,7 +512,7 @@ namespace XCharts currData = yValue ? showData[j].GetData(1) : showData[j].GetData(0); } if (inverse) currData = -currData; - if(!serie.IsIgnoreValue(currData)) + if (!serie.IsIgnoreValue(currData)) _serieTotalValueForMinMax[j] = _serieTotalValueForMinMax[j] + currData; } }