TreemapItem Class

A Treemap dashboard item that allows you to display large amounts of hierarchically structured (tree-structured) data.

Declaration

export class TreemapItem extends DataDashboardItem

Remarks

The Treemap dashboard item can be used to visualize data in nested rectangles that are called tiles.

wdd-treemap-grouped

The following documentation is available: Web Dashboard - Creating a Treemap.

Examples

The following example shows how to create the Treemap dashboard item, bind it to data and add to the existing dashboard.

Create data items (measures and dimensions) and use the DataItem.dataMember property to bind them to the existing data source's columns. Then use the created measures and dimensions in the dashboard item to bind it to data.

After you add the created dashboard item to the Dashboard.items collection, call the Dashboard.rebuildLayout method to rebuild the dashboard layout and display changes.

// Use the line below for a modular approach:
// import * as Model from 'devexpress-dashboard/model'
// Use the line below for an approach with global namespaces:
// var Model = DevExpress.Dashboard.Model;

// ...
public createTreemapItem() { 
    // Create data items for the Treemap dashboard item.
    var treemapCategoryName = new Model.Dimension();
    treemapCategoryName.dataMember("CategoryName");
    var treemapProductName = new Model.Dimension();
    treemapProductName.dataMember("ProductName");
    var treemapUnitPrice = new Model.Measure();
    treemapUnitPrice.dataMember("UnitPrice");

    // Create the Treemap dashboard item and bind it to data.
    var treemapItem = new Model.TreemapItem();
    treemapItem.name('treemap');
    treemapItem.dataSource(sqlDataSource.componentName());
    treemapItem.dataMember(sqlDataSource.queries()[0].name());

    treemapItem.arguments.push(treemapCategoryName, treemapProductName);
    treemapItem.values.push(treemapUnitPrice);

    treemapItem.interactivityOptions.isDrillDownEnabled(true);

    control.dashboard().items.push(treemapItem);
    // ...
    control.dashboard().rebuildLayout();
}

constructor

Initializes a new instance of the TreemapItem class.

Declaration

constructor(modelJson?: any, serializer?: DevExpress.Analytics.Utils.ModelSerializer)

Optional Parameters

Name Type Default Description
modelJson any null

A JSON object used for dashboard deserialization. Do not pass this parameter directly.

serializer ModelSerializer null

An object used for dashboard deserialization. Do not pass this parameter directly.

Properties

arguments Property

Declaration

arguments: ko.ObservableArray<Dimension>

Property Value

Type Description
ko.ObservableArray<Dimension>

colorScheme Property

Declaration

colorScheme: ko.ObservableArray<ColorSchemeEntry>

Property Value

Type Description
ko.ObservableArray<ColorSchemeEntry>

coloringOptions Property

Declaration

coloringOptions: DashboardItemColoringOptions

Property Value

Type Description
DashboardItemColoringOptions

groupsLabelContentType Property

Declaration

groupsLabelContentType: ko.Observable<TreemapValueType>

Property Value

Type Description
ko.Observable<TreemapValueType>

groupsTooltipContentType Property

Declaration

groupsTooltipContentType: ko.Observable<TreemapValueType>

Property Value

Type Description
ko.Observable<TreemapValueType>

interactivityOptions Property

Declaration

interactivityOptions: DashboardItemInteractivityOptions

Property Value

Type Description
DashboardItemInteractivityOptions

layoutAlgorithm Property

Declaration

layoutAlgorithm: ko.Observable<DashboardTreemapLayoutAlgorithm>

Property Value

Type Description
ko.Observable<DashboardTreemapLayoutAlgorithm>

layoutDirection Property

Declaration

layoutDirection: ko.Observable<DashboardTreemapLayoutDirection>

Property Value

Type Description
ko.Observable<DashboardTreemapLayoutDirection>

tilesLabelContentType Property

Declaration

tilesLabelContentType: ko.Observable<TreemapValueType>

Property Value

Type Description
ko.Observable<TreemapValueType>

tilesTooltipContentType Property

Declaration

tilesTooltipContentType: ko.Observable<TreemapValueType>

Property Value

Type Description
ko.Observable<TreemapValueType>

values Property

Declaration

values: ko.ObservableArray<Measure>

Property Value

Type Description
ko.ObservableArray<Measure>

Methods

getInfo Method

For internal use.

Declaration

getInfo(): DevExpress.Analytics.Utils.ISerializationInfoArray

Returns

Type Description
ISerializationInfoArray

An array of objects that provide serialization info.