> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpertai.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Sankey Diagram

**Sankey Diagram** is a specific type of flow diagram used to describe the flow from one set of values to another.

Characteristics of Sankey diagrams:

* Starting flow and ending flow are the same, the sum of all main branch widths equals the sum of all outgoing branch widths, maintaining energy balance;
* Internally, different lines represent different flow distribution situations, and their widths proportionally display the flow occupied by this branch;
* Different node widths represent flow magnitudes in specific states.

There are two data display methods for creating Sankey diagrams:

* Flow relationships between multiple dimensions.
* Flow relationships of a dimension hierarchy.

## Between Multiple Dimensions

Select the chart type as Sankey Diagram (Sankey), and set one measure and multiple dimensions.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/xpertai/en/bi/widget/analysis-card/sankey-dimensions-attributes.png" alt="Small" />

This method displays measure relationships between different dimension members.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/xpertai/en/bi/widget/analysis-card/sankey-dimensions.png" alt="Middle Shadow" />

### Chart Direction

You can set the chart's direction property to change the Sankey diagram's horizontal or vertical display.

## Single Dimension Hierarchy

You can also set only one hierarchical measure for the Sankey diagram display.

Select a dimension, select the finest level to display and set its property **Include Parent Levels**, and the data will calculate hierarchical data for this level and all its parent members.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/xpertai/en/bi/widget/analysis-card/sankey-hierarchy-attributes.png" alt="Small" />

Sankey diagram displaying hierarchy:

<img src="https://mintlify.s3.us-west-1.amazonaws.com/xpertai/en/bi/widget/analysis-card/sankey-hierarchy.png" alt="" />

### Containing All Members

This function checks if the hierarchical structure already contains an **All member**. If it does, you can set the **Contains All Members** property in the **Series Styles** of the Sankey diagram, and the Sankey diagram will not add a new All node. Otherwise, the Sankey diagram will automatically add an All node to the data.

## 示例

<iframe src="https://app.xpertai.cn/public/story/point/7c440106-a90e-4014-8279-698ff9c2d239" width="100%" height="1000px" frameBorder="0" scrolling="no" allowFullScreen />
