From 96cb7ffc7409cfeb43cea29194074d1f966f9978 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 4 Jun 2024 08:40:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Serie`=E7=9A=84`state`?= =?UTF-8?q?=E5=9C=A8=E4=BB=A3=E7=A0=81=E5=8A=A8=E6=80=81=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=88=B7=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/en/api.md | 1 + Documentation~/zh/api.md | 1 + Documentation~/zh/changelog.md | 1 + Runtime/Serie/SerieHandler.cs | 12 ++++++++++++ 4 files changed, 15 insertions(+) diff --git a/Documentation~/en/api.md b/Documentation~/en/api.md index d2d5d46f..1ab1902e 100644 --- a/Documentation~/en/api.md +++ b/Documentation~/en/api.md @@ -1467,6 +1467,7 @@ the data struct of graph. |GetNodesTotalValue()||public static double GetNodesTotalValue(List<GraphNode> nodes)| |GetRootNodes()||public List<GraphNode> GetRootNodes()| |GraphData()||public GraphData(bool directed)| +|IsAllNodeInZeroPosition()||public bool IsAllNodeInZeroPosition()| |Refresh()||public void Refresh()| ## GraphEdge diff --git a/Documentation~/zh/api.md b/Documentation~/zh/api.md index 378015c0..2036f211 100644 --- a/Documentation~/zh/api.md +++ b/Documentation~/zh/api.md @@ -1467,6 +1467,7 @@ DataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息 |GetNodesTotalValue()||public static double GetNodesTotalValue(List<GraphNode> nodes)| |GetRootNodes()||public List<GraphNode> GetRootNodes()| |GraphData()||public GraphData(bool directed)| +|IsAllNodeInZeroPosition()||public bool IsAllNodeInZeroPosition()| |Refresh()||public void Refresh()| ## GraphEdge diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 2fb6337f..9d7e5555 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -73,6 +73,7 @@ slug: /changelog ## master +* (2024.06.04) 修复`Serie`的`state`在代码动态设置时不刷新的问题 * (2024.05.29) 调整`XCharts`在`Hierarchy`视图下的右键菜单到`UI/XCharts`下 * (2024.05.29) 增加`3D`坐标系对类目轴的支持 * (2024.05.19) 优化`Editor`下的编辑性能 diff --git a/Runtime/Serie/SerieHandler.cs b/Runtime/Serie/SerieHandler.cs index fa08c07a..b750ef6e 100644 --- a/Runtime/Serie/SerieHandler.cs +++ b/Runtime/Serie/SerieHandler.cs @@ -150,6 +150,18 @@ namespace XCharts.Runtime } if (serie.interactDirty) { + if (serie.animation.enable && serie.animation.interaction.enable) + { + Color32 color1, toColor1; + bool needInteract = false; + foreach (var serieData in serie.data) + { + var state = SerieHelper.GetSerieState(serie, serieData, true); + SerieHelper.GetItemColor(out color1, out toColor1, serie, serieData, chart.theme, state); + serieData.interact.SetColor(ref needInteract, color1, toColor1); + } + } + chart.RefreshChart(); serie.interactDirty = false; m_ForceUpdateSerieContext = true; }