diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index 2795e816..e308d64e 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -1,6 +1,7 @@ # 更新日志 +* (2020.09.18) Fixed `SerieLabel` also displayed after hided `Serie` by clicked the legend #94 * (2020.09.18) Optimize coordinate axis calibration and text display #93 * (2020.09.17) fixed `Package` import missing `meta` file causing failure #92 * (2020.09.08) Optimize the color of `Legend` to automatically match the custom color of `ItemStyle` diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index ba87a145..0235e5ad 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -1,6 +1,7 @@ # 更新日志 +* (2020.09.18) 修复`SerieLabel`在点击图例隐藏`Serie`后还显示的问题#94 * (2020.09.18) 优化坐标轴刻度和文本显示#93 * (2020.09.17) 修复`Package`导入时缺失`meta`文件导致失败的问题#92 * (2020.09.08) 优化`Legend`的颜色可自动匹配`ItemStyle`的自定义颜色#89 diff --git a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs index 1a29c8ff..a7ffff06 100644 --- a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs +++ b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs @@ -1498,9 +1498,13 @@ namespace XCharts var isPercentStack = SeriesHelper.IsPercentStack(m_Series, serie.stack, SerieType.Bar); for (int j = 0; j < serie.data.Count; j++) { - if (j >= serie.dataPoints.Count) break; var serieData = serie.data[j]; if (serieData.labelObject == null) continue; + if (j >= serie.dataPoints.Count) + { + serieData.SetLabelActive(false); + continue; + } var pos = serie.dataPoints[j]; var serieLabel = SerieHelper.GetSerieLabel(serie, serieData); var dimension = 1; @@ -1539,6 +1543,7 @@ namespace XCharts } else { + Debug.LogError("lable not show:" + i + "," + j); serieData.SetLabelActive(false); } }