public static void CalculateRectangles(RectangleF containerRect, IEnumerable <TreeMapNode> treeMapNodes, double value)
        {
            TreeMapSquaringAlgorithm           treeMapSquaringAlgorithm = new TreeMapSquaringAlgorithm();
            IEnumerable <TreeMapDataPointInfo> enumerable = treeMapSquaringAlgorithm.Split(containerRect, value, treeMapNodes);

            foreach (TreeMapDataPointInfo item in enumerable)
            {
                RectangleF  rect = item.Rect;
                TreeMapNode node = item.Node;
                node.Rectangle = rect;
                if (node.Children != null)
                {
                    TreeMapSquaringAlgorithm.CalculateRectangles(node.Rectangle, node.Children, node.Value);
                }
            }
        }
Exemplo n.º 2
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));
                }
            }
            double             value = default(double);
            List <TreeMapNode> list  = default(List <TreeMapNode>);

            TreeMapChart.BuildTreeNodes(common, area, out value, out list);
            RectangleF plottingArea = TreeMapChart.GetPlottingArea(graph, area);

            TreeMapSquaringAlgorithm.CalculateRectangles(plottingArea, list, value);
            graph.SetClip(graph.GetRelativeRectangle(plottingArea));
            TreeMapChart.RenderDataPoints(graph, common, list);
            TreeMapChart.RenderLabels(graph, area, list);
            graph.ResetClip();
        }