Using a Sankey diagram

Contents[Hide]

1. Overview

The Sankey diagram displays how quantities are distributed among items between two or more stages.

2. Add a Sankey diagram

Choose the Data Visualization or Re-Visualize option from the toolbar and select Sankey Diagram.

Select Sankey Diagram
Select Sankey Diagram

Drag one or more hierarchies or hierarchy levels to Rows in the Data Analysis Panel. Each hierarchy will be displayed as another level if you select multiple hierarchies, or you can select multiple levels of a hierarchy.

In our example, we have selected a multi-level hierarchy. To visualize multiple levels of a hierarchy at once, click to edit it in the Data Analysis Panel and set the Top Level and Level to a range of levels, or drag a lower level from under the hierarchy in the Explore window.

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 river-like arrangement based on the hierarchies and their levels. Each value in the hierarchy is displayed as a rectangle called a "node".

River-like arrangement of Sankey diagram
River-like arrangement of Sankey diagram

An essential part of a Sankey diagram is a measure that determines the widths of the links between each node. Drag a measure (numeric data) to Measures in the Data Analysis Panel to visualize its quantities flowing between the items.

Flow of quantities visualized
Flow of quantities visualized

2.1. Display custom flow

If your data has information about a quantity transferring between pairs of items, the Sankey diagram can visualize these items according to the connections in your data instead of displaying a hierarchical structure.

By default, the hierarchies you've added are assigned under Source Name in the Data Analysis Panel's Visualization tab. Assigning a Target Name will display the custom flow between each source-target pair.

Custom flow displayed by assigning Target Name
Custom flow displayed by assigning Target Name

We are using a dataset containing source-target pairs to describe the links in the diagram between pairs of nodes (displayed as rectangles). If you want to customize or display further information about individual nodes based on your data, you will need a second metric set providing a row of information for each node rather than for each pair of nodes.

Note
When not using source-target pairs to display a custom flow, all the settings can be configured on the same metric set and you will not be able to add a second metric set to the Data Analysis Panel.

Click Metric Set in the Data Analysis Panel, and then click Add New or + button.

Add a new metric set
Add a new metric set

Drag a hierarchy or column of data corresponding with the values already used as sources and targets onto Rows. You can then add additional measures and hierarchies and use them in tooltips, for colors or other visualization options in the Visualization tab.

To display the links in different colors according to data, assign it under Color in the Data Analysis Panel's Visualization tab in the Links section.

Assign a measure under Color
Assign a measure under Color

One or more color rules are applied to the links in the diagram. You can modify the the color rules by clicking the brush icon next to Color, or by going to the Look tab of the Properties window. These settings work the same way as in other visualizations, such as charts.

To change what measure is used to determine the widths of the links, remove the measure assigned under Width in the Links section if there is one and add the measure of your choice.

Assign a measure to Width
Assign a measure to Width

4. Change node color

To display the nodes in different colors according to data, assign it under Color in the Data Analysis Panel's Visualization tab in the Nodes section.

Add a measure under Color for nodes
Add a measure under Color for nodes

As with the links, one or more color rules are applied to the nodes in the diagram, and can be customized in the Properties window.

5. Change labels and tooltips

In the Text tab of the Properties window, 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 captions, 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, assign data under Label in either the Nodes or Links section to display it as a label over each node or link.

Add a measure under Label for links
Add a measure under Label for links

Click the brush icon next to the Label heading to open the relevant properties. The keyword (e.g., [OrderQty]) has already been added to the Text property. 

Adjust the link labels
Adjust the link labels

6. 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