This topic describes how to view query results in a pie chart. The topic also introduces pie chart examples.
Background information
A pie chart is used to show the percentages of categorical variables. In a pie chart, the arc length of each segment is proportional to the quantity each categorical variable represents. A pie chart is divided into multiple segments based on the percentages of categorical variables. Each segment shows the percentage of a categorical variable. The sum of all percentages is equal to 100%.
- Segment
- Percentage in the text format
- Legend
Types
- Donut chart
A donut chart is a variant of the pie chart with a hollow center. A donut chart provides the following benefits over a pie chart:
- Displays more information, such as the total value.
- Allows you to compare data between two donut charts based on the ring lengths. Data across different pie charts is difficult to compare.
- Polar area chart
A polar area chart is a column chart in the polar coordinate system. Each categorical variable is represented by a segment with the same angle, and the radius of each segment differs depending on the value. A polar area chart provides the following benefits over a pie chart:
- Is suitable when the number of data entries ranges from 10 to 30. The pie chart is suitable when the number of data entries is no more than 10.
- Enlarges the differences among the values of categorical variables because the area of the segment has a correlation to the square of the radius. Therefore, the polar area chart is suitable for the comparison of similar values.
- Is suitable for analyzing value change characteristics in different periods, such as weeks and months. This is because a circle can be used to display a periodic pattern.
Procedure
Example of a pie chart
To analyze the percentages of different values for the request_uri
field, execute the following query statement:
* | select request_uri as uri , count(1) as c group by uri limit 10

Example of a donut chart
To analyze the percentages of different values for the request_uri
field, execute the following query statement:
* | select request_uri as uri , count(1) as c group by uri limit 10

Example of a polar area chart
To analyze the percentages of different values for the request_uri
field, execute the following query statement:
* | select request_uri as uri , count(1) as c group by uri limit 10
