From ecb09e4ca44141c054e721e8dfca4ccf76ad9a56 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Fri, 18 Sep 2020 22:00:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`SerieLabel`=E5=9C=A8?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=9B=BE=E4=BE=8B=E9=9A=90=E8=97=8F`Serie`?= =?UTF-8?q?=E5=90=8E=E8=BF=98=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?#94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/XCharts/CHANGELOG-EN.md | 1 + Assets/XCharts/CHANGELOG.md | 1 + Assets/XCharts/Runtime/Internal/CoordinateChart.cs | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) 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); } }