menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class TreeMapRangeBrushSettings

    Provides settings for defining range based brushes in the SfTreeMap.

    Inheritance
    System.Object
    TreeMapBrushSettings
    TreeMapRangeBrushSettings
    Namespace: Syncfusion.Maui.TreeMap
    Assembly: Syncfusion.Maui.TreeMap.dll
    Syntax
    public class TreeMapRangeBrushSettings : TreeMapBrushSettings

    Constructors

    TreeMapRangeBrushSettings()

    Declaration
    public TreeMapRangeBrushSettings()

    Fields

    RangeBrushesProperty

    Identifies the RangeBrushes dependency property.

    Declaration
    public static readonly BindableProperty RangeBrushesProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for RangeBrushes dependency property.

    Properties

    RangeBrushes

    Gets or sets the collection of range based brushes for the SfTreeMap.

    Declaration
    public List<TreeMapRangeBrush> RangeBrushes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<TreeMapRangeBrush>

    The default value of RangeBrushes is an empty list.

    Remarks

    The RangeBrushes property allows you to specify a list of TreeMapRangeBrush instances, where each instance defines a specific range and its associated background brush.

    Examples

    The below examples shows, how to set RangeBrushes property of TreeMapRangeBrushSettings in the SfTreeMap.

    • XAML
    • C#
    • C#
    • C#
     <treemap:SfTreeMap x:Name="treeMap"
                        RangeColorValuePath="EmployeesCount"
                        PrimaryValuePath="EmployeesCount"
                        DataSource="{Binding EmployeeDetails}">
       <treemap:SfTreeMap.BindingContext>
           <local:EmployeeViewModel />
       </treemap:SfTreeMap.BindingContext>
       <treemap:SfTreeMap.LeafItemBrushSettings>
           <treemap:TreeMapRangeBrushSettings>
               <treemap:TreeMapRangeBrushSettings.RangeBrushes>
                   <treemap:TreeMapRangeBrush LegendLabel="1 % growth" From="1" To="50" Brush="#77D8D8" />
                   <treemap:TreeMapRangeBrush LegendLabel="2 % Growth" From="51" To="100" Brush="#AED960" />
               </treemap:TreeMapRangeBrushSettings.RangeBrushes>
           </treemap:TreeMapRangeBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
       <treemap:SfTreeMap.LeafItemSettings>
           <treemap:TreeMapLeafItemSettings LabelPath="JobDescription">
           </ treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
    </treemap:SfTreeMap>
    public class EmployeeDetails
    {
       public string Category { get; set; }
       public string Country { get; set; }
       public string JobDescription { get; set; }
       public string JobGroup { get; set; }
       public int EmployeesCount { get; set; }
    }
    public class EmployeeViewModel
    {
        public EmployeeViewModel()
        {
           this.EmployeeDetails = new ObservableCollection<EmployeeDetails>()
           {
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Technical", JobGroup = "Testers", EmployeesCount = 100 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "HR Executives", EmployeesCount = 30 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Accounts", EmployeesCount = 40 },
           };
        }
       public ObservableCollection<EmployeeDetails> EmployeeDetails
       {
           get;
           set;
        }
    }
    this.treeMap.LeafItemBrushSettings = new TreeMapRangeBrushSettings()
    {
       RangeBrushes = new List<TreeMapRangeBrush>()
       {
           new TreeMapRangeBrush() { LegendLabel = "1 % growth", Brush = new SolidColorBrush(Color.FromArgb("#77D8D8")), From = 1, To = 50,},
           new TreeMapRangeBrush() { LegendLabel = "1 % growth", Brush = new SolidColorBrush(Color.FromArgb("#AED960")), From = 51, To = 100,},
       }
    };
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved