diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index c1561784..df87dfd9 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -65,6 +65,7 @@ slug: /changelog ## master +* (2023.02.28) 修复`Legend`点击时`Serie`的`Label`不刷新的问题 * (2023.02.26) 增加`DataZoom`的`startEndFunction`委托 * (2023.02.12) 重构`Component`相关代码,调整API接口 * (2023.02.10) 修复`Axis`在`Log`轴时某些情况下最小值不正确的问题 diff --git a/Runtime/Internal/BaseChart.Serie.cs b/Runtime/Internal/BaseChart.Serie.cs index 27e39bc9..282e5da5 100644 --- a/Runtime/Internal/BaseChart.Serie.cs +++ b/Runtime/Internal/BaseChart.Serie.cs @@ -647,6 +647,7 @@ namespace XCharts.Runtime public void SetSerieActive(Serie serie, bool active) { serie.show = active; + serie.RefreshLabel(); serie.AnimationReset(); if (active) serie.AnimationFadeIn(); UpdateLegendColor(serie.serieName, active); diff --git a/Runtime/Serie/SerieHandler.cs b/Runtime/Serie/SerieHandler.cs index e1ae60e8..184983a3 100644 --- a/Runtime/Serie/SerieHandler.cs +++ b/Runtime/Serie/SerieHandler.cs @@ -385,6 +385,7 @@ namespace XCharts.Runtime var isIgnore = serie.IsIgnoreIndex(serieData.index, defaultDimension); if (serie.show && currLabel != null && + currLabel.show && serieData.context.canShowLabel && !isIgnore) {