Using a Relationship Diagram

 

Contents[Hide]

1. Overview

The relationship diagram displays information about the relationships between data. While other visualizations show many of the relationships implicitly within the visualization, the relationship diagram displays it explicitly.

2. Data preparation

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

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

To illustrate the hierarchical relationships, create the following hierarchy and apply it to TerritoryID. 

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

3. Add a relationship diagram

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

Select Relationship Diagram
Select Relationship Diagram

Drag the TerritoryID dimension from the data cube in the Explore panel to the Rows field. Edit TerritoryID in the Data Analysis Panel. Set the Top Level to be different from the Level.

Set the Top Level to be different from the Level
Set the Top Level to be different from the Level

The diagram is displayed in a tree-like arrangement based on the hierarchy assigned to TerritoryID.

Tree-like arrangement of relationship diagram
Tree-like arrangement of relationship diagram

Note
While in View mode, you can rearrange nodes by dragging. Drag a child node to move only it, or drag a parent node to move the whole cluster. When dropped, nodes will gravitate toward the parent node and the whole cluster will gravitate toward the center of the viewport.

3.1. Display custom relationships

To display custom relations between nodes, the data must have source and target node pairs. By default, the hierarchies in Rows are added to the Source Name property. Adding an element to the Target Name property will display the custom relationship.

Select Visualization in the Data Analysis Panel.

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

Drag the Group dimension from the data cube in the Explore panel to the Target Name field.

Custom relationship display
Custom relationship display

Drag the SalesYTD measure from the data cube in the Explore panel 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 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.

Drag the SalesQuota and SalesLastYear measures from the data cube in the Explore panel to the Length and Width fields respectively.

Add measures to the Length and Width fields
Add measures to the Length and Width fields

Auto Size Rules are applied to the links in the diagram. You can modify the settings of the Length Rules and Stroke Width Rules in the same manner as modifying the color rule.

Note
Using a dimension in the color, length, or width field 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.

5. Change node color and size

Since the data in the source/target pair is used to describe the links in the diagram, it is not possible to associate other measures or hierarchies to the nodes. In order to assign data to nodes, a second metric set has to be added to the visualization.

Note
When not using source/target pairs, all the settings can be configured on the same metric set. You will not be able to add a second metric set to the Data Analysis Panel.

Click Metric Set in the Data Analysis Panel, then click Add New.

Add a new metric set
Add a new metric set

Drag the TerritoryID dimension from the data cube in the Explore panel to the Rows field. Edit TerritoryID and set the Top Level to be the same as in the previous metric set.

Click Visualization in the Data Analysis Panel. Drag the Bonus measure from the data cube in the Explore panel to the Color field. 

Add a measure to the Color field of the nodes
Add a measure to the Color field of the nodes

As with the links, an Auto Color Rule is applied to the nodes in the diagram.

Drag the CommissionPct measure from the data cube in the Explore panel to the Size field.

Add a measure to the Size field of the nodes
Add a measure to the Size field of the nodes

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, use the dropdown at the top of the Data Analysis Panel to switch back to the first metric set (the one specifying the color and length of the links). Drag SalesQuota measure from the Length field to the 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 [SalesQuota] has already been added to the Text field. Change the keyword to [SalesQuota:N0] to remove the decimal points.

Adjust the link labels
Adjust the link labels

7. Properties

The following are some noteworthy properties in relationship diagrams.

7.1. Selected Style

Data brushing in relationship diagrams is split into two parts:

  1. Nodes – change the appearance of the node when related data is selected.
  2. Links – change the appearance of links when data related to the Source Name is selected.

You can adjust the style for each of these separately.

In the Look tab of the Properties panel, click Selected Style in the applicable section.

Click Selected Style to adjust the data brushing style
Click Selected Style to adjust the data brushing style

As an example, change the Selected Style for links to use Red strokes of width 2.

Change the Selected Style for links
Change the Selected Style for links

Copy-paste the diagram in the same dashboard and switch to View mode. Hover over a source node in one diagram to see it selected in the other.

Hover over a source node
Hover over a source node

For comparison, change the relationship to use Group as the source name. Change to View mode and hover over a source node in one diagram to see it selected in the other.

Hover over a source node
Hover over a source node

Tip
Use the Show Link Arrows property to see the direction from the Source Name to the Target Name.

By default, links appear as straight lines connecting two nodes. If you have two nodes that are the source and target of each other, the lines will overlap and the relationship will be less noticeable. To show such a relationship, change the Link Type property to Curve.

Change the Link Type to Curve
Change the Link Type to Curve

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