This topic describes how to configure an area chart to display query results. It also includes examples.
An area chart is constructed based on a line chart. The section between a line and the axis that is filled with a color is an area in an area chart. The color highlights the trend. Similar to a line chart, an area chart emphasizes the numeric value changes over time, and is used to highlight the overall data trend. Both the line chart and the area chart indicate the trend and relationship of numeric values. They are not suitable if you want to display specific values.
- X-axis (horizontal)
- Y-axis (vertical)
- Area block
- Log on to the Log Service console.
- Click the target project in the Projects section.
- Choose , click the management icon of the target Logstore, and then select .
- Enter a query statement in the search box, select a time range, and then click Search & Analyze.
- Click to display the query results in an area chart.
- On the Properties tab on the right, configure the properties of the area chart.Note In an area chart, a single area block must contain more than two data points. Otherwise, the data trend cannot be analyzed. We recommend that you configure no more than five area blocks in an area chart.
Configuration item Description X Axis The data on the X-axis, which is usually a time sequence. Y Axis The numeric data. You can configure one or more fields on the Y-axis. Legend The position where the legend is located in the chart. Valid values: Top, Bottom, Left, and Right. Format The format in which data is displayed. Margin The distance of the axis to the borders of the chart, including Top Margin, Bottom Margin, Right Margin, and Left Margin. Stacking If you turn on this switch, the Y-axis data is stacked.
Example of a simple area chart
To query the page views (PVs) of the IP address
10.0.0.0 in the last 24 hours, run the following statement:
remote_addr: 10.0.0.0 | select date_format(date_trunc('hour', __time__), '%m-%d %H:%i') as time, count(1) as PV group by time order by time limit 1000
timefor X Axis and
PVfor Y Axis.
Example of a cascade chart
* | select date_format(date_trunc('hour', __time__), '%m-%d %H:%i') as time, count(1) as PV, approx_distinct(remote_addr) as UV group by time order by time limit 1000
timefor X Axis. Select
UVfor Y Axis.