The bar chart is another form of column chart, that is, a horizontal column chart. It is typically used for top N analysis and is configured in a way similar to a column chart.

Components

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

Each rectangular block has fixed height but varying width to indicate the value. You can use a grouped bar 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 bar chart.
  3. On the right-side Properties tab, configure the properties of the bar chart.
    Note
    • Use the bar 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. You can use a ORDER BY clause for top N analysis. We also recommend that you map no more than five columns of data to the Y-axis.
    • Use the grouped bar chart only if different types of data are simultaneously increased or decreased.

Properties

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

Example

To analyze the request_uri with the top 10 largest number of visits and display the analysis results in a simple bar chart, run the following statement:

* | select  request_uri, count(1) as count group by request_uri order by count desc limit 10
Figure 1. Simple bar chart