private void DrawSingleRadar(VertexHelper vh, Serie serie, int i) { var startPoint = Vector3.zero; var toPoint = Vector3.zero; var firstPoint = Vector3.zero; var radar = m_Radars[serie.radarIndex]; var indicatorNum = radar.indicatorList.Count; var angle = 2 * Mathf.PI / indicatorNum; var centerPos = radar.runtimeCenterPos; var serieNameCount = -1; serie.animation.InitProgress(1, 0, 1); if (!IsActive(i) || serie.animation.HasFadeOut()) { return; } var rate = serie.animation.GetCurrRate(); var dataChanging = false; var dataChangeDuration = serie.animation.GetUpdateAnimationDuration(); int key = i * 1000; if (!radar.runtimeDataPosList.ContainsKey(key)) { radar.runtimeDataPosList.Add(i * 1000, new List <Vector3>(serie.dataCount)); } else { radar.runtimeDataPosList[key].Clear(); } var pointList = radar.runtimeDataPosList[key]; var startIndex = GetStartShowIndex(serie); var endIndex = GetEndShowIndex(serie); for (int j = 0; j < serie.data.Count; j++) { var serieData = serie.data[j]; serieData.index = j; string dataName = serieData.name; int serieIndex = 0; if (string.IsNullOrEmpty(dataName)) { serieNameCount++; serieIndex = serieNameCount; } else if (!serieNameSet.ContainsKey(dataName)) { serieNameSet.Add(dataName, serieNameCount); serieNameCount++; serieIndex = serieNameCount; } else { serieIndex = serieNameSet[dataName]; } if (!serieData.show) { serieData.labelPosition = Vector3.zero; continue; } var isHighlight = serie.highlighted || serieData.highlighted || (m_Tooltip.show && m_Tooltip.runtimeDataIndex[0] == i && m_Tooltip.runtimeDataIndex[1] == j); var areaColor = SerieHelper.GetAreaColor(serie, m_ThemeInfo, serieIndex, isHighlight); var areaToColor = SerieHelper.GetAreaToColor(serie, m_ThemeInfo, serieIndex, isHighlight); var lineColor = SerieHelper.GetLineColor(serie, m_ThemeInfo, serieIndex, isHighlight); int dataCount = radar.indicatorList.Count; var index = serieData.index; var p = radar.runtimeCenterPos; var min = radar.GetIndicatorMin(index); var max = radar.GetIndicatorMax(index); var value = serieData.GetCurrData(1, dataChangeDuration); if (serieData.IsDataChanged()) { dataChanging = true; } if (max == 0) { serie.GetMinMaxData(index, out min, out max); min = radar.GetIndicatorMin(index); } var radius = max < 0 ? radar.runtimeDataRadius - radar.runtimeDataRadius * value / max : radar.runtimeDataRadius * value / max; var currAngle = (index + (radar.positionType == Radar.PositionType.Between ? 0.5f : 0)) * angle; radius *= rate; if (index == startIndex) { startPoint = new Vector3(p.x + radius * Mathf.Sin(currAngle), p.y + radius * Mathf.Cos(currAngle)); firstPoint = startPoint; } else { toPoint = new Vector3(p.x + radius * Mathf.Sin(currAngle), p.y + radius * Mathf.Cos(currAngle)); if (serie.areaStyle.show) { ChartDrawer.DrawTriangle(vh, startPoint, toPoint, p, areaColor, areaColor, areaToColor); } if (serie.lineStyle.show) { DrawLineStyle(vh, serie.lineStyle, startPoint, toPoint, lineColor); } startPoint = toPoint; } serieData.labelPosition = startPoint; pointList.Add(startPoint); if (serie.areaStyle.show && j == endIndex) { ChartDrawer.DrawTriangle(vh, startPoint, firstPoint, centerPos, areaColor, areaColor, areaToColor); } if (serie.lineStyle.show && j == endIndex) { DrawLineStyle(vh, serie.lineStyle, startPoint, firstPoint, lineColor); } } if (serie.symbol.type != SerieSymbolType.None) { for (int j = 0; j < serie.data.Count; j++) { var serieData = serie.data[j]; if (!serieData.show) { continue; } var isHighlight = serie.highlighted || serieData.highlighted || (m_Tooltip.show && m_Tooltip.runtimeDataIndex[0] == i && m_Tooltip.runtimeDataIndex[1] == j); var serieIndex = serieData.index; var symbolSize = (isHighlight ? serie.symbol.selectedSize : serie.symbol.size); var symbolColor = SerieHelper.GetItemColor(serie, serieData, m_ThemeInfo, serieIndex, isHighlight); var symbolToColor = SerieHelper.GetItemToColor(serie, serieData, m_ThemeInfo, serieIndex, isHighlight); var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, isHighlight); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, isHighlight); DrawSymbol(vh, serie.symbol.type, symbolSize, symbolBorder, serieData.labelPosition, symbolColor, symbolToColor, serie.symbol.gap, cornerRadius); } } if (!serie.animation.IsFinish()) { serie.animation.CheckProgress(1); RefreshChart(); } if (dataChanging) { RefreshChart(); } }