diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index e28e2a04..c78daece 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -83,6 +83,7 @@ slug: /changelog 日志详情: +* (2023.11.30) 增加`SerieData`可单独添加`Label`的支持 * (2023.11.28) 修复`Tooltip`在对数轴时指示不准确的问题 * (2023.11.24) 修复`Chart`的`UpdateData()`接口返回值不准确的问题 * (2023.11.24) 修复`Axis`的更新数据时效果不顺畅的问题 diff --git a/Runtime/Serie/SerieHelper.cs b/Runtime/Serie/SerieHelper.cs index 0179451f..573e2c26 100644 --- a/Runtime/Serie/SerieHelper.cs +++ b/Runtime/Serie/SerieHelper.cs @@ -469,7 +469,9 @@ public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, SerieSt else { var stateStyle = GetStateStyle(serie, serieData, state); - return stateStyle == null || !stateStyle.show ? serie.label : stateStyle.label; + if (stateStyle != null && stateStyle.show) return stateStyle.label; + else if (serieData.labelStyle != null) return serieData.labelStyle; + else return serie.label; } } @@ -483,7 +485,9 @@ public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, Seri else { var stateStyle = GetStateStyle(serie, serieData, state); - return stateStyle == null || !stateStyle.show ? serie.labelLine : stateStyle.labelLine; + if (stateStyle != null && stateStyle.show) return stateStyle.labelLine; + else if (serieData.labelLine != null) return serieData.labelLine; + else return serie.labelLine; } } @@ -497,7 +501,9 @@ public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData, Serie else { var stateStyle = GetStateStyle(serie, serieData, state); - return stateStyle == null || !stateStyle.show ? serie.symbol : stateStyle.symbol; + if (stateStyle != null && stateStyle.show) return stateStyle.symbol; + else if (serieData.symbol != null) return serieData.symbol; + else return serie.symbol; } }