Pie charts
A pie chart shows the proportions of different categories. You can compare categories by the size of their slices.
Introduction
A pie chart divides a circle into slices based on the proportion of each category. The entire circle represents the total value, and all slices add up to 100%. Simple Log Service provides three types of pie charts: pie charts, doughnut charts, and polar area charts.
-
Doughnut chart: A doughnut chart is a pie chart with a hollow center. A doughnut chart has the following advantages over a standard pie chart:
-
Displays additional information, such as the total value.
-
Provides a more intuitive comparison when viewing multiple doughnut charts side by side.
-
-
Polar area chart: A polar area chart is a column chart drawn in a polar coordinate system. Each category is represented by a slice with an equal angle, and the radius of each slice is proportional to its value. Compared to a standard pie chart, a polar area chart has the following advantages:
-
Pie charts work well for up to 10 categories. Polar area charts are better suited for 10 to 30 categories.
-
Because the area of a slice is related to the square of its radius, a polar area chart emphasizes differences between values, making it ideal for comparing values that are close to each other.
-
Because circles represent cycles, a polar area chart is also useful for time-based data, such as days of the week or months of the year.
-
For more information about how to add a chart to a dashboard, see Add a chart to a dashboard.
Overview
|
Type |
Example |
Related topics |
|
Basic pie chart |
|
|
|
Doughnut chart |
|
|
|
Polar area chart |
|
|
|
Merged multi-query |
|
Configure a basic pie chart
Log on to the Simple Log Service console. In the Projects section, click the project you want.

-
In the left-side navigation pane, choose . In the Dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, choose .
-
In the configuration panel on the right, set the Chart Type and configure the Query and Analysis Configurations. In the query editor, configure the time range, Logstore, and query statement. Then, click Apply at the top of the page to view the chart.

The following query statement counts the page views (PVs) for different browsers:
(*)| select count(1) as pv, case when http_user_agent like '%Chrome%' then 'Chrome' when http_user_agent like '%Firefox%' then 'Firefox' when http_user_agent like '%Safari%' then 'Safari' else 'unKnown' end as http_user_agent group by case when http_user_agent like '%Chrome%' then 'Chrome' when http_user_agent like '%Firefox%' then 'Firefox' when http_user_agent like '%Safari%' then 'Safari' else 'unKnown' end order by pv desc limit 10
General configurations
General configurations define global parameters for the pie chart.
-
Basic configurations
Parameter
Description
Title
The title of the pie chart.
Display Title
Turn on Display Title to show the chart title.
Display Border
Turn on Display Border to show the chart border.
Display Background
Turn on Display Background to show the background color of the chart.
Display Time
Turn on Display Time to show the query time range.
Fixed Time
Turn on Fixed Time to make the chart's time range independent of the global time range of the dashboard.
-
Standard configurations
Parameter
Description
Format
The display format for numbers.
Unit
The unit for numbers.
Decimal Places
The number of decimal places for numbers.
Display Name
The display name for the field.
Color Scheme
The color scheme for the pie chart.
-
Built-in: Use the built-in colors.
-
Monochrome: Select a single color.
-
-
Query and analysis configurations
Parameter
Description
Category
The field used for data categorization.
Value Column
The field that contains the numeric values to display.
-
Pie chart configurations
Parameter
Description
Pie Chart Type
The type of pie chart. Valid values: Pie Chart, Doughnut Chart, and Polar Area Chart.
Label Format
The format of the labels on the chart.
-
Percentage: displays the scale text in the Percentage format. Example: 1.98%.
-
Category: Percentage: Displays the label in the Category: Percentage format, such as PUT: 1.98%.
-
Category: Value (Percentage): Displays the label in the Category: Value (Percentage) format, such as PUT: 120(1.98%).
Show Labels
Select Yes to display labels on the chart.
-
-
Legend configurations
Parameter
Description
Display Legend
Turn on Display Legend to show the legend.
Legend Position
The position of the legend.
Action
The behavior when a legend item is clicked.
-
Select: When you click a legend item, the chart displays only the data for that item.
-
Toggle: When you click a legend item, the data for that item is hidden. Click it again to show the data.
Max Width (Height) %
The maximum width or height of the legend, as a percentage.
-
-
Variable substitution
Parameter
Description
Variable substitution
Variable substitution adds a variable-type filter to the chart. After configuration in General configurations, a filter appears in the upper-left corner of the chart. When you select a value, Simple Log Service replaces the variable in the query statement and reruns the analysis. Example 2: Set variable substitution.
-
Documentation link
Parameter
Description
Add Documentation Link
A custom documentation link or description. After configuration, the information appears in the upper-right corner of the chart.
Field configurations
Field configurations customize the visualization of results from a single query or a single column. For more information about the configuration items, see General configurations.
For example, A > pv configures the pv field from Query and Analysis A. In the following figure, Standard Configurations > Color Scheme is set to Monochrome.

Interaction events
Interaction events let you drill down into a specific field or query result for deeper analysis. Available actions include opening a Logstore, a saved search, or a dashboard, navigating to Trace Analysis or Trace Details, and creating a custom HTTP link. For more information, see Add interaction events to a dashboard for drill-down analysis.
For example, A is used to set an interaction event for the results of Query A. If you set the event to Open Logstore, you can click any point on the pie chart and then click Open Logstore to navigate to the specified Logstore.




