修复Seriestate在代码动态设置时不刷新的问题

This commit is contained in:
monitor1394
2024-06-04 08:40:43 +08:00
parent 74cf4fe4ce
commit 96cb7ffc74
4 changed files with 15 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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`下的编辑性能

View File

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