A Sankey diagram, also known as a Sankey energy balance diagram, is a specific type of flowchart. Data flows from nodes on the left to nodes on the right, with the height of each node representing the size of the data. The width of each link is proportional to the flow value; the wider the link, the greater the flow value it represents. Sankey diagrams are used to illustrate the distribution of flows and structural comparisons, and are commonly applied in data visualization analysis in fields such as energy, material composition, and finance.
Node: The "rectangular" part in the diagram, as shown below. Nodes represent different categories, that is, the dimensions of the visualization query.
Link: The flow line connecting nodes. The thickness of the flow line reflects the magnitude of the flow, which is the metric of the visualization query.
Sankey diagrams are typically used for data visualization analysis with flow relationships, such as population migration between different countries or the destinations of product sales and more.
Sankey diagram example
Step 1: Set dimensions, metrics, and filter conditions
The first step in using a Sankey diagram is to set the dimensions, metrics, and filter conditions for the diagram. Dimensions correspond to the nodes in the Sankey diagram, and metrics correspond to the thickness of the links.
For example, to visualize the following sales data table as a Sankey diagram in order to observe the regional flow of sales revenue.
Select the dimensions: country, region, and province/autonomous region, which correspond to the three columns of nodes in the Sankey diagram.
Select the metric: sales revenue (sum), which corresponds to the links in the Sankey diagram.
Step 2: Draw the Sankey diagram
The Sankey diagram is drawn as follows: the links connect the nodes "from country to region" and "from region to province/autonomous region", representing the proportion of "national sales revenue flowing to each region" and "regional sales revenue flowing to each province" respectively. The thickness of the links indicates the level of sales revenue.
Highlight flow paths and display data results
When the mouse hovers over any node or path, a data tooltip is displayed.
When a traffic path is clicked, that path is highlighted.
The Sankey diagram supports two or more dimensions and one metric.
The Sankey diagram supports custom color settings, and the product provides multiple built-in color schemes.
The links in the Sankey diagram support both curved and straight styles, which can be selected as needed. The product uses the curved style by default.
Curved example:
Straight example:
Dimension labels can be enabled, and their alignment style can be configured.
Legend:
Labels:
Caution: Only one of "Sparse display" or "Allow overlap" can be selected for the display mode. If one is selected, the other is grayed out, with a prompt stating "Allow overlap and sparse display cannot be selected at the same time." When labels are crowded by default, it is recommended to select "Sparse display."
See 3.11 In-chart control styles.
Click [Restore Default Settings] to restore all items in the above chart configuration to default