Pie Chart¶
A pie chart uses a circle divided into slices of different proportions to represent the proportion of data in the total amount, and the value is usually expressed as a percentage. All parts of the pie chart add up to 100%.
Types of Pie Chart¶
The basic type of pie chart is a donut-shaped pie chart. Based on this, DTV has preset several common pie chart types. When adding a pie chart to the page, you can choose from the following types according to the business scenario:
Pie chart type |
style |
describe |
Recommended scenarios |
---|---|---|---|
Basic pie chart |
Display multiple proportions of a single metric. |
Display the overall proportion of a certain metric. |
|
Basic pie chart (with data labels) |
Add data labels based on the basic pie chart. |
In addition to displaying proportions, specific values also need to be displayed visually. |
|
Solid pie chart |
Fill the pie chart solid based on the basic pie chart. |
The visual effects are more prominent. |
|
Multi-metric pie chart |
Display the composition ratio of multiple metrics. |
When your data only has multiple metrics and there is no single dimension to summarize each data, the multi-metric pie chart can help you generate a pie chart showing the distribution of the proportions of multiple metrics. |
|
Multi-metric pie chart (with data labels) |
Add data labels based on multi-metric pie charts. |
In addition to displaying proportions, specific values also need to be displayed visually. |
|
rose diagram |
Display the proportion of metrics in each dimension through the angle and length of the sector, and more clearly display the relative size and proportion of each metric. |
Suitable for scenarios that require comparative analysis and proportion comparison. |
Data of Pie Chart¶
The data in the pie chart takes metrics as the core, limits and subdivides the metric data through dimensions, and enriches the display of data trends through expansion.
For more information about data sources and data items, see Common Configurations for Widgets.
Basic pie chart¶
When your data contains both dimension and metric data, for example, in the data below, Type
is the dimension and CarbonEmission
is the metric.
At this time, the data of the basic pie chart can be configured as follows:
Measurements¶
Metrics are the core data displayed in pie charts. In the above example, the basic pie chart displays the data proportion of the CarbonEmission
metric under different Type
. Each area in the pie chart displays the carbon emission value under each equipment type. The carbon emission here is the ** metric. **. Only 1 metric is supported in the basic pie chart.
Dimensions¶
In the data source, the metrics have been classified based on a certain dimension. For example, the metric data can be divided into rows of data by device type Type
. The Type
data item can now be configured in the dimension. After configuration, the pie chart can display the data and proportion of one metric data in different dimensions.
If there are no dimensions in your data and you want to use multiple metric data to generate a single pie chart, you can use a multi-metric pie chart.
Extensions¶
If you need to display other information in the pie chart, such as the same period value of the metric last month, you can add data items in Extension to display the same period data of the previous month in the pie chart.
Extended data can be displayed in the following locations in a pie chart:
Sum: The sum is located in the center of the pie chart. By default, Sum displays the accumulated value of all the metric values. You can replace the value in the sum with any extension field in Show Extension Fields and Sum will show the first value of the extension field. For example, after selecting
LastMonthCarbonEmission
, Sum will display the carbon emissions ofType A
in the same period last month.
Legend: By default, the values in the legend are the values of each sector in the pie chart. You can replace the values in the legend with any Extended fields in Show extended fields as reference data for pie chart metric values.
Multiple-Metric Pie Chart¶
When your data does not have dimensions, such as in the table below, which only has multiple metric data, the basic pie chart cannot support this type of data. At this time, it is recommended to use a multi-metric pie chart to generate the chart.
Data for a multi-metric pie chart can be configured as follows:
Measurements¶
Metrics are the core data displayed in pie charts. In the example above, the multi-metric pie chart shows each Type
metric as a percentage of the total. By default, the latest data is displayed, which is the first row of data in the data list. If necessary, you can use dimension aggregation to aggregate the data under the metric in columns and display it. The aggregation methods include sum, average, etc. For dimension aggregation, see Display Aggregated Data.
Extensions¶
In multi-metric pie charts, extension fields have no effect.
Style of Pie Chart¶
In the Style tab, you can configure the style of the pie chart. The following is a description of some pie chart style configuration items.
Ring to Cutout Ratio¶
When your pie chart shape is ring, the display area of the pie chart will be determined by both the outer circle and the inner circle. in:
Inner Diameter is the diameter of the inner circle at the center of the pie chart.
Outer diameter is the difference between the diameter of the outer circle and the inner circle.
You can adjust the thickness of the ring by adjusting the ratio of the inner diameter to the outer diameter.
Sum Data¶
SUM is the value at the center of the pie chart. By default, Sum displays the sum of the values already on the pie chart, in the same units as the other values. If necessary, you can configure the center of the pie chart to display other fields in Display Extension.
Legend¶
The legend is a common auxiliary element in pie charts to help users better interpret the data in the pie charts. Legends usually contain the following information:
Color icon: The color label corresponding to each sector area.
Name: The name of the data item represented by each sector area. In a basic pie chart, the name is usually dimension. In a multi-metric pie chart, the name is the name of the metric.
Value or percentage: The specific value or proportion of each sector area.
Unit: The unit of the value.
Legend Length¶
Legend name display word count determines the display length of the pie chart legend name. For example, when setting the number of characters displayed in the legend name to 3, only the first 3 characters of the pie chart legend name will be displayed, and other characters will be omitted. 1 kanji is counted as 1 character.
If not specified, 10 characters will be displayed by default and other characters will be omitted.
Legend Position¶
Legend position is the position of the legend relative to the pie chart. The legend position defaults to the right.
When the legend is to the left or right, you can adjust the proportion of the legend in the widget through Chart to Legend Ratio.
When the legend is moved up or down, the proportion of the legend is fixed and cannot be adjusted.
Data Label¶
Data labels are text or numerical information marked on each sector. Properly setting the position and style of data labels can effectively improve the readability of the pie chart.
Label Position: Configure data labels to be displayed outside the pie chart, on the pie chart, or in the center of the pie chart.
Label Font: Configure the font, size and color of data labels.