Overview
Expected Effect
Place different indicators on the same pie chart to display their percentages.
For example, you can use a pie chart to display the percentage of Unit price and Total contract price (RMB) among different indicators.
Solution
Establish the analysis subject at first. Add two datasets and create a column Class to add the main text data (the headers of the columns to be merged). Then, merge the Total contract price (RMB) and Unit price indicators into one column through Union All, and create a pie chart.
Procedure
This example uses the table Project product sales data under Data Center > Industry Data > Real Estate.
Adding the Total Contract Price (RMB) Dataset
1. Establish the analysis subject and add the Project product sales data dataset, as shown in the following figure.
2. Choose More > Field Settings and select the Product Name, Contract date, and Total contract price (RMB), as shown in the following figure.
3. Select Formula Column, name it Class, fill the body with "Total contract price (RMB)", and click OK.
4. Click Save and Update to rename the dataset as Total contract price (RMB), as shown in the following figure.
Adding the Unit Price Dataset
1. Add the Project product sales data dataset again, choose More > Field Settings, and select the Product Name, Contract date, and Unit price, as shown in the following figure.
2. Select Formula Column, name it Class, fill the body with "Unit price", and click OK.
3. Click Save and Update to rename the dataset as Unit price, as shown in the following figure.
Union All
Click Union All, select Total contract price (RMB), and click OK.
For more details about Union All, see Union All.
4. Edit the merge table, merge Total contract price (RMB) and Unit price based on Product Name and Contract date, and rename the column name as Price, as shown in the following figure.
5. Save and update the dataset.
Creating a Pie Chart
1. Click the Pie Chart icon and drag Class to Color, Price to Angle, and Class to Label.
2. Click the icon of Price in Angle and choose Quick Calculation > Percentage.
3. Click the icon of Price in Angle and select Value Format, tick Percentage, and click OK.
Effect Display
The Total contract price (RMB) and Unit price are displayed as percentages on the same pie chart, as shown in the following figure.