A statistical chart can display results from multiple query statements, combining several single-value visualizations into one chart with customizable settings for each field.
Prerequisites
-
Log data is collected. For more information, see Collect text logs from servers.
-
An index is created. For more information, see Create indexes.
-
A dashboard is created. For more information, see Create a dashboard quickly.
Overview

-
Query and analyze data : Calculate the number of unique visitors (UV) and page views (PV) for a webpage in the Log Service console.
-
Configure a statistical chart with multiple queries : Add a statistical chart to display both
UVandPVdata, set the background color forUVto orange andPVto blue, and then add the chart to the target dashboard.
Step 1: Query and analyze data
Log on to the Simple Log Service console. In the Projects section, click the project you want.

-
In the left-side navigation pane, click Log Storage. In the Logstores list, click the target Logstore.
-
Enter the following query statements and click Search & Analyze to view the logs.
-
Calculate the UV value.
status < 400 | SELECT approx_distinct(client_ip) AS UV -
Calculate the PV value.
status < 400 | SELECT count(*) AS PV
-
Step 2: Configure a statistical chart with multiple queries
1. Add a statistical chart
In the left-side navigation pane, choose . From the Dashboard list, click the target dashboard. In the upper-right corner of the dashboard, click Edit. In edit mode, click .
2. Configure multiple queries
On the right side of the page, go to and select the statistical chart
. Configure the time range, Logstore, and query statements, and then click Apply to preview the chart.
-
: Select the UV field from query A.
-
: Select the PV field from query B.
Set the time range to 15min (Last 15 Minutes) and select the website_log Logstore. For Query A, set the query statement to status < 400 | SELECT approx_distinct(client_ip) AS UV. For Query B, set the query statement to status < 400 | SELECT count(*) AS PV. After you click Apply, the statistical chart displays both UV and PV results.
3. Configure colors
On the right side of the page, on the Field Configuration tab, customize the colors for the statistical chart. For more information, see Statistical chart.
-
In the A section, configure the visualization settings for query A results. Set the color to orange.
-
In the B section, configure the visualization settings for query B results. Set the color to blue.
In the Standard Configurations section, set the color for each group from the Color Scheme drop-down list. Select Solid as the scheme type.
4. Save the chart and dashboard
-
In the upper-right corner of the chart editing page, click OK.
-
In the upper-right corner of the dashboard editing page, click Save.