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
- On the Search & Analysis page of a Logstore, enter a search and analytics statement
in the search box, specify the time range, and then click Search & Analyze.
The Chart tab is automatically displayed when a query is completed.
- 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.