Using a Tree Diagram

 

Contents[Hide]

1. Overview

The Tree diagram displays information about the hierarchical structure of the data. Displayed like a tree, this relationship diagram is often used to display organizational charts and other family descent structures.

2. Data preparation

To follow the examples in this article, create the following data cube from the Adventure Works database using the [Sales].[SalesPerson][Sales].[SalesTerritory], and [Person].[Person] tables.

A data cube joining the SalesPerson, SelesTerritory, and Person tables
A data cube joining the SalesPerson, SelesTerritory, and Person tables

To illustrate the hierarchical relationships, use the following custom data to create a hierarchy and apply it to TerritoryID. 

Custom data for country names and IDs
Custom data for country names and IDs

A data cube joining the SalesPerson and SalesTerritory tables
A data cube joining the SalesPerson and SalesTerritory tables

To illustrate the ability to display images in nodes, place a folder with images in a location accessible for the Dundas BI application. The folder in this example is located inside the instance folder:

[Inastance name]/www/BIWebsite/Content/Images/pics

3. Add a Tree diagram

While in the dashboard designer, use the Data Visualization option from the toolbar and select Tree Diagram.

Select Tree Diagram
Select Tree Diagram

Drag the TerritoryID dimension from the data cube in the Explore panel to the Rows (nodes) field.

Horizontal tree diagram
Horizontal tree diagram

Drag the FirstName dimension from the data cube to the Rows (nodes) field.

The diagram is displayed in a horizontal tree-like arrangement based on the order of the hierarchies.

Horizontal tree diagram with sales people
Horizontal tree diagram with sales people

Switch to View mode. Right-click the United States of America node and select Expand.

Expand a node
Expand a node

4. Change node color and size

Switch back to Edit mode.

Open the Visualization tab of the Data Analysis Panel.

Select Visualization in the Data Analysis Panel
Select Visualization in the Data Analysis Panel

Drag the SalesLastYear measure from the data cube to the Color field.

Add a measure to the Color field
Add a measure to the Color field

An Auto Color Rule is applied to the nodes in the diagram. You can modify the settings of the rule by clicking the brush icon next to the Color field, or going to the Look section of the Properties panel and selecting Auto Color Rule.

Tip
Adding the first measure directly to the metric set instead of a specific visualization field will automatically assign it to both the node and link color fields.

Drag the SalesYTD measure from the data cube to the Size field.

Auto Size Rules are applied to the nodes in the diagram. You can modify the settings of the Size Rules in the same manner as modifying the color rule. For example, click the brush icon to the right of the Size field and change the Distribution to Equal Distribution.

Add a measure to the Size field
Add a measure to the Size field

Note
Using a dimension in the color or size fields would enable the use of discrete rules. Rather than automatically spread across a range, discrete rules enable you to modify the formatting for a single value.

4.1. Display images in nodes

To use the images in our pics folder as background for the Tree diagram nodes, open the Look properties.

Type the following into the Image Path field:

/Content/Images/pics/[Member].jpg

The member placeholder will use the member name of each node to retrieve the relevant image.

Add an image path
Add an image path

Note
If you have the images paths for the different members in you database, you can drag the image path hierarchy onto the Image field of the Data Analysis Panel Visualization tab and the Image Path field will be updated accordingly. When using this option with a measure present in the metric set, edit the image path hierarchy and change the Shown Totals drop-down to No Totals.

Expand the Links section of the Data Analysis Panel and drag the SalesLastYear measure to the Color field.

An Auto Color Rule is applied to the links in the diagram. You can modify the settings of the rule by clicking the brush icon next to the Color field, or going to the Look section of the Properties panel and selecting Auto Color Rule. For example, click the brush icon to the right of the field and change the Distribution to Equal Distribution and adjust the colors.

Add color to the links
Add color to the links

Drag the SalesYTD measure to the Width field.

Add width to the links
Add width to the links

The width of each link is now defined by its fraction of the total.

6. Change labels and tooltips

Under the Text section of the Properties panel, you can customize the Label Text and Tooltip Text properties for both the links and the nodes.

These properties accept regular text, as well as keywords such as [Member] and [Level] for the hierarchy member and level caption respectively. For additional information about available keywords, refer to the Formatting Text article.

As a shortcut for applying the proper keyword, you can use the Visualization tab in the Data Analysis Panel.

For example, drag the SalesYTD measure to the Links Label field.

Add a measure to the Label field of the links
Add a measure to the Label field of the links

Click the brush image next to the Label field to open the relevant properties section. The keyword [SalesYTD] has already been added to the Text field. Change the keyword to [SalesYTD:N0] to remove the decimal points.

Adjust the link labels
Adjust the link labels

7. Tree Orientation

The tree orientation can go either from left to right (horizontal) or from top to bottom (vertical). To change the orientation, open the Layout properties and select your choice from the Tree Orientation drop-down.

Change the orientation to Vertical
Change the orientation to Vertical

8. See also

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri