Headers and Labels in Windows Forms TreeMap
3 Sep 2020 / 1 minute to read
Labels and headers in a tree map can be customized using the following properties available in the tree map control:
Code sample
TreeMap TreeMap1 = new TreeMap();
PopulationViewModel data = new PopulationViewModel();
TreeMap1.ItemsSource = data.PopulationDetails;
TreeMap1.WeightValuePath = "Population";
TreeMap1.ColorValuePath = "Growth";
TreeMap1.ItemsLayoutMode = Syncfusion.Windows.Forms.TreeMap.ItemsLayoutModes.SliceAndDiceAuto;
TreeMapFlatLevel treeMapFlatLevel1 = new TreeMapFlatLevel();
treeMapFlatLevel1.GroupPath = "Continent";
treeMapFlatLevel1.ShowLabels = true;
TreeMap1.Levels.Add(treeMapFlatLevel1);
TreeMapFlatLevel treeMapFlatLevel2 = new TreeMapFlatLevel();
treeMapFlatLevel2.GroupPath = "Country";
treeMapFlatLevel2.ShowLabels = true;
treeMapFlatLevel2.HeaderHeight = 25;
TreeMap1.Levels.Add(treeMapFlatLevel2);
TreeMap1.HeaderBrush = new SolidBrush(Color.Blue);
TreeMap1.LabelBorderBrush = new SolidBrush(Color.White);
TreeMap1.LabelBorderThickness = 5;
TreeMap1.LabelBackgroundBrush = new SolidBrush(Color.LightSkyBlue);
TreeMap1.LabelBrush = new SolidBrush(Color.White);
TreeMap1.LabelFont = new System.Drawing.Font("Segoe UI Semibold", 13F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
DesaturationColorMapping desaturationColorMapping = new DesaturationColorMapping();
desaturationColorMapping.Color = Color.OrangeRed;
desaturationColorMapping.From = 220;
desaturationColorMapping.To = 0;
desaturationColorMapping.RangeMinimum = 0;
desaturationColorMapping.RangeMaximum = 80000;
this.TreeMap1.LeafColorMapping = desaturationColorMapping;
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page