Skip to main content

TreeMapControl Class

Displays flat and hierarchical data by using nested rectangles. See TreeMap Control.

Namespace: DevExpress.XtraTreeMap

Assembly: DevExpress.XtraTreeMap.v24.1.UI.dll

NuGet Package: DevExpress.Win.TreeMap

Declaration

[ComVisible(true)]
public class TreeMapControl :
    HierarchicalChartControlBase

Remarks

The DevExpress WinForms TreeMap Control provides all the functionality required to display tree maps in your WinForms applications. You are free to use a data source representing flat data and group it, or the hierarchical data source for visualization.

The control has built-in item highlighting, selection and tooltips.

The following image demonstrates a TreeMapControl.

TreeMapControl

To get acquainted with using the TreeMapControl, please refer to the Getting Started section.

Example

To provide flat data to a TreeMap, create a TreeMapFlatDataAdapter object and assign it to the TreeMapControl.DataAdapter property. Then, specify the adapter’s TreeMapFlatDataAdapter.DataSource, TreeMapFlatDataAdapter.LabelDataMember and TreeMapFlatDataAdapter.ValueDataMember to configure the data source object and which data members should be used to generate tree map items. If you need to group generated items, add the name of a data member whose values should be used to group items, to the TreeMapFlatDataAdapter.GroupDataMembers collection.

void ConfigureTreeMapDataAdapter() {
    TreeMapFlatDataAdapter adapter = new TreeMapFlatDataAdapter {
        DataSource = CreateBillionaireInfos(),
        LabelDataMember = "Name",
        ValueDataMember = "NetWorth"
    };
    adapter.GroupDataMembers.Add("Residence");
    treeMap.DataAdapter = adapter;
}

Implements

Inheritance

Object
MarshalByRefObject
Component
Control
DevExpress.XtraEditors.XtraControl
See Also