Based on a line chart, the area chart fills the section between a line and the axis with color. The filled section is an area block and the color highlights the trend. Similar to a line chart, an area chart emphasizes the number changes over time, and is used to highlight the trend of the total number. Both the line chart and the area chart are mostly used to indicate the trend and relationship, but not to display specific values.

Components

  • X-axis (horizontal)
  • Y-axis (vertical)
  • Area block

Procedure

  1. On the search page of a Logstore, enter a query and analysis statement in the search box, set the time range, and then click Search & Analysis.
  2. On the Graph tab, click to select the area chart.
  3. On the right-side Properties tab, configure the properties of the area chart.
    Note In an area chart, a single area block must contain more than two data records to guarantee that the data trend can be analyzed. We also recommend that you configure no more than five area blocks in an area chart.

Properties

Configuration item Description
X Axis The data on the X-axis, which is usually a time sequence.
Y Axis The numeric data. You can map one or more columns of data to 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.

Example

Simple area chart

To query the page views (PVs) of the IP address 10.0.192.0 within the last day, run the following statement:

remote_addr: 10.0.192.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

Select time for X Axis and PV for Y Axis.

Figure 1. Simple area chart


Stacked area 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

Select time for X Axis. Select PV and UV for Y Axis.

Figure 2. Stacked area chart