From 735e36d6e539a3b66617a6427ae3300c9c34f378 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 30 Nov 2023 22:36:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0`SerieData`=E5=8F=AF=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E6=B7=BB=E5=8A=A0`Label`=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Serie/SerieHelper.cs | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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; } }