private static void RenderNodes(CommonElements common, ChartGraphics graph, CategoryNodeCollection nodes, RectangleF rectRelative, double chartTotal, float incrementXRelative, float incrementYRelative, List <Series> seriesCollection) { float startAngle = 270f; foreach (Series item in seriesCollection) { RenderNodes(common, graph, nodes, rectRelative, 1, chartTotal, ref startAngle, 360f, incrementXRelative, incrementYRelative, item, GetFirstNonEmptyDataPointsAttributes(item)); } }
private static void RenderNodes(CommonElements common, ChartGraphics graph, CategoryNodeCollection nodes, RectangleF rectRelative, int level, double parentValue, ref float startAngle, float parentSweepAngle, float incrementXRelative, float incrementYRelative, Series series, DataPointAttributes dataPointAttributes) { if (!nodes.AreAllNodesEmpty(series)) { nodes.SortByAbsoluteValue(series); RectangleF absoluteRectangle = graph.GetAbsoluteRectangle(rectRelative); float thresholdAngle = (float)(360.0 / (6.2831853071795862 * (double)absoluteRectangle.Width)); PointF centerAbsolute = new PointF((float)(absoluteRectangle.X + absoluteRectangle.Width / 2.0), (float)(absoluteRectangle.Y + absoluteRectangle.Height / 2.0)); float centerRadiusAbsolute = (float)(graph.GetAbsoluteWidth(rectRelative.Width - incrementXRelative) / 2.0); float absoluteWidth = graph.GetAbsoluteWidth((float)(rectRelative.Width / 2.0)); foreach (CategoryNode node in nodes) { SunburstChart.RenderNode(common, graph, node, rectRelative, level, parentValue, ref startAngle, parentSweepAngle, thresholdAngle, incrementXRelative, incrementYRelative, centerAbsolute, centerRadiusAbsolute, absoluteWidth, series, dataPointAttributes); } } }
private static void RenderNodes(CommonElements common, ChartGraphics graph, ChartArea area, RectangleF plottingAreaRelative) { if (!(plottingAreaRelative.Width < 0f) && !(plottingAreaRelative.Height < 0f)) { CategoryNodeCollection categoryNodes = area.CategoryNodes; if (categoryNodes != null) { List <Series> chartAreaSeries = GetChartAreaSeries(area.Name, common.DataManager.Series); categoryNodes.Calculate(chartAreaSeries); double totalAbsoluetValue = categoryNodes.GetTotalAbsoluetValue(); SortSeriesByAbsoluteValue(chartAreaSeries, categoryNodes); int num = 2 * (categoryNodes.GetDepth() + 1); float num2 = plottingAreaRelative.Width / (float)num; float num3 = plottingAreaRelative.Height / (float)num; float num4 = num2 * 4f; float num5 = num3 * 4f; RectangleF rectRelative = new RectangleF(plottingAreaRelative.X + plottingAreaRelative.Width / 2f - num4 / 2f, plottingAreaRelative.Y + plottingAreaRelative.Height / 2f - num5 / 2f, num4, num5); RenderNodes(common, graph, categoryNodes, rectRelative, totalAbsoluetValue, num2, num3, chartAreaSeries); } } }
private static void SortSeriesByAbsoluteValue(List <Series> seriesCollection, CategoryNodeCollection nodes) { seriesCollection.Sort((Series series1, Series series2) => nodes.GetTotalAbsoluteValue(series2).CompareTo(nodes.GetTotalAbsoluteValue(series1))); }