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;
            }
        }
Example #2
0
        private static void RenderNodes(CommonElements common, ChartGraphics graph, CategoryNodeCollection nodes, RectangleF rectRelative, double chartTotal, float incrementXRelative, float incrementYRelative, List <Series> seriesCollection)
        {
            float num = 270f;

            foreach (Series item in seriesCollection)
            {
                SunburstChart.RenderNodes(common, graph, nodes, rectRelative, 1, chartTotal, ref num, 360f, incrementXRelative, incrementYRelative, item, SunburstChart.GetFirstNonEmptyDataPointsAttributes(item));
            }
        }
Example #3
0
        public void Paint(ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw)
        {
            foreach (Series item in common.DataManager.Series)
            {
                if (item.IsVisible() && item.ChartArea == area.Name && string.Compare(item.ChartTypeName, this.Name, true, CultureInfo.CurrentCulture) != 0 && !common.ChartPicture.SuppressExceptions)
                {
                    throw new InvalidOperationException(SR.ExceptionChartCanNotCombine(this.Name));
                }
            }
            RectangleF plottingAreaRelative = SunburstChart.GetPlottingAreaRelative(graph, area);

            graph.SetClip(plottingAreaRelative);
            SunburstChart.RenderNodes(common, graph, area, plottingAreaRelative);
            graph.ResetClip();
        }
Example #4
0
 private static void RenderNodes(CommonElements common, ChartGraphics graph, ChartArea area, RectangleF plottingAreaRelative)
 {
     if (!(plottingAreaRelative.Width < 0.0) && !(plottingAreaRelative.Height < 0.0))
     {
         CategoryNodeCollection categoryNodes = area.CategoryNodes;
         if (categoryNodes != null)
         {
             List <Series> chartAreaSeries = SunburstChart.GetChartAreaSeries(area.Name, common.DataManager.Series);
             categoryNodes.Calculate(chartAreaSeries);
             double totalAbsoluetValue = categoryNodes.GetTotalAbsoluetValue();
             SunburstChart.SortSeriesByAbsoluteValue(chartAreaSeries, categoryNodes);
             int        num          = 2 * (categoryNodes.GetDepth() + 1);
             float      num2         = plottingAreaRelative.Width / (float)num;
             float      num3         = plottingAreaRelative.Height / (float)num;
             float      num4         = (float)(num2 * 4.0);
             float      num5         = (float)(num3 * 4.0);
             RectangleF rectRelative = new RectangleF((float)(plottingAreaRelative.X + plottingAreaRelative.Width / 2.0 - num4 / 2.0), (float)(plottingAreaRelative.Y + plottingAreaRelative.Height / 2.0 - num5 / 2.0), num4, num5);
             SunburstChart.RenderNodes(common, graph, categoryNodes, rectRelative, totalAbsoluetValue, num2, num3, chartAreaSeries);
         }
     }
 }