[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Collapse]TreeMap Control
   [Expand]Getting Started
   [Collapse]Providing Data
    [Expand]Examples
   [Expand]Layout Algorithms
   [Expand]Colorizers
   [Expand]End-User Interaction
   [Expand]Visual Elements
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Providing Data

The TreeMap Control visualizes groups and leafs that should be provided to the TreeMap control using the TreeMapControl.DataAdapter property. This topic describes ways to provide tree map items for displaying. The following approaches are supported.

Expanded Manually Create Tree Map Items

The TreeMapItemStorage is used to provide map items manually. To display an item, add it to the TreeMapItemStorage.Items collection.To manually provide a group to the TreeMap, add a tree map item to the storage items collection and populate the item's TreeMapItem.Children collection.

The following image shows a TreeMap populated with items manually.

Refer to the How to: Manually Add Items to a Tree Map example to learn more.

Expanded Adapt Flat Data

To visualize flat data, use the TreeMapFlatDataAdapter adapter. This adapter converts data members specified using the TreeMapFlatDataAdapter.DataMember property to tree map items with values obtained from a data member specified using the TreeMapFlatDataAdapter.ValueDataMember property and labels obtained from a data member specified using the TreeMapFlatDataAdapter.LabelDataMember property.

To group automatically generated items, add TreeMapGroupDefinition object to the TreeMapFlatDataAdapter.Groups collection. Using group definition, you can specify which data member values should be used to group items. Use the TreeMapGroupDefinition.GroupDataMember property for that.

The following image demonstrates the use of the data adapter.

Refer to the How to: Provide Flat Data to a Tree Map example to learn more.

Expanded Adapt Hierarchical Data

It is possible to visualize hierarchical data using the TreeMapHierarchicalDataAdapter adapter. This adapter visualizes your data members using the explicit data adapters. Using the TreeMapHierarchicalDataAdapter.ValueDataMember property, it is possible to specify which data member values should be used as item values.

The following image shows hierarchical data visualized using the TreeMap.

Refer to the How to: Provide Hierarchical Data to a Tree Map example to learn more.

Expanded See Also

Is this topic helpful?​​​​​​​