diff --git a/Runtime/Internal/Data/GraphData.cs b/Runtime/Internal/Data/GraphData.cs index b7ea07d8..cc293751 100644 --- a/Runtime/Internal/Data/GraphData.cs +++ b/Runtime/Internal/Data/GraphData.cs @@ -42,11 +42,27 @@ namespace XCharts.Runtime double totalValue = 0; foreach (var node in nodes) { - totalValue += node.totalValues; + if (node.IsAnyInEdgesExpanded()) + { + totalValue += node.totalValues; + } } return totalValue; } + public static int GetExpandedNodesCount(List nodes) + { + int count = 0; + foreach (var node in nodes) + { + if (node.IsAnyInEdgesExpanded()) + { + count++; + } + } + return count; + } + public List> GetDepthNodes() { List> depthNodes = new List>();