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; }