private void SetTreemapItemsParameters(int i, List<TreemapItem> items) { TreemapIndex index = Parameters.Indexes[i]; foreach (TreemapItem item in items) { item.IndexParameters = index; if (index.HasHeader && Parameters.Algorithm != TreemapAlgorithm.Circular) { FontStyle style = index.FontBold ? FontStyle.Bold : FontStyle.Regular; Font font = new Font(DefaultFontFamily, (float)index.FontSize, style, GraphicsUnit.Pixel); float height = font.RenderText(item.Indexes.Last()).Height; item.SetMargin(new Margin(index.Padding.Left, height, index.Padding.Right, index.Padding.Bottom)); } if (i == Indexes.Count - 1) item.FillColor = Parameters.Color.GetColor(item.Color); else item.FillColor = index.FillColor; } }