The column chart uses vertical or horizontal columns to compare the numeric data among different types. A line chart describes the ordered data, whereas a column chart describes different types of data and counts the number in each data type.

You can also use multiple rectangular blocks to display the data of a type in grouped or stacked mode to analyze the differences of this data type in different dimensions.

Components

  • X-axis (horizontal)
  • Y-axis (vertical)
  • Rectangular block
  • Legend

Log Service uses vertical columns in a column chart by default. Each rectangular block has fixed width but varying height to indicate the value. You can use a grouped column chart to display the data if multiple columns of data are mapped to the Y-axis.

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 column chart.
  3. On the right-side Properties tab, configure the properties of the column chart.
    Note Use the column chart if the number of data types is no more than 20. We recommend that you use the LIMIT syntax to control the number of data types. Analysis results may not be clearly displayed if the chart contains excessive rectangular blocks. We also recommend that you map no more than five columns of data to the Y-axis.

Properties

Configuration item Description
X Axis The types of data.
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 Y-axis The format in which data is displayed on the Y-axis.
Margin The distance of the axis to the borders of the chart, including Top Margin, Bottom Margin, Right Margin, and Left Margin.

Example

Simple column chart

To query the number of visits for each http_referer in the current time interval, run the following statement:

* | select  http_referer, count(1) as count group by http_referer

Select http_referer for X Axis and count for Y Axis.

Figure 1. Simple column chart


Grouped column chart

To query the number of visits and the average bytes for each http_referer in the current time interval, run the following statement:

* | select  http_referer, count(1) as count, avg(body_bytes_sent) as avg group by http_referer

Select http_referer for X Axis. Select count and avg for Y Axis.

Figure 2. Grouped column chart