Example #1
0
        private static void RenderNode(CommonElements common, ChartGraphics graph, CategoryNode node, RectangleF rectRelative, int level, double parentValue, ref float startAngle, float parentSweepAngle, float thresholdAngle, float incrementXRelative, float incrementYRelative, PointF centerAbsolute, float centerRadiusAbsolute, float edgeRadiusAbsolute, Series series, DataPointAttributes dataPointAttributes)
        {
            double absoluteValue = node.GetValues(series).AbsoluteValue;

            if (absoluteValue != 0.0)
            {
                CategoryNode dataPointNode = node.GetDataPointNode(series);
                DataPoint    dataPoint;
                int          dataPointIndex;
                if (dataPointNode != null)
                {
                    dataPoint      = dataPointNode.GetDataPoint(series);
                    dataPointIndex = dataPointNode.Index;
                }
                else
                {
                    dataPoint      = null;
                    dataPointIndex = -1;
                }
                DataPointAttributes dataPointAttributes2 = (dataPoint != null) ? dataPoint : dataPointAttributes;
                float num        = (float)(absoluteValue / parentValue * (double)parentSweepAngle);
                float sweepAngle = num - thresholdAngle;
                using (GraphicsPath sliceGraphicsPath = SunburstChart.RenderSlice(common, graph, node, dataPoint, dataPointAttributes2, rectRelative, startAngle, sweepAngle, centerAbsolute, edgeRadiusAbsolute, level, dataPointIndex))
                {
                    SunburstChart.RenderLabel(common, graph, node, dataPoint, dataPointAttributes2, SunburstChart.GetLabelText(node, dataPoint, series, dataPointAttributes2), startAngle, num, centerAbsolute, centerRadiusAbsolute, dataPointIndex, sliceGraphicsPath);
                }
                if (node.Children != null)
                {
                    float num2 = startAngle;
                    SunburstChart.RenderNodes(common, graph, node.Children, RectangleF.Inflate(rectRelative, incrementXRelative, incrementYRelative), level + 1, absoluteValue, ref num2, num, incrementXRelative, incrementYRelative, series, dataPointAttributes);
                }
                startAngle += num;
            }
        }