This topic describes how to configure a flow chart to display query results.

Chart upgrade

Log Service provides charts (Pro) to display query and analysis results. You can use a chart (Pro) to visualize the results of multiple query statements. You can also configure custom settings for fields. You can click Migrate to convert a common flow chart to a flow chart (Pro). For more information about the flow chart (Pro), see Flow chart (Pro).
Notice After you convert a common chart to a chart (Pro), you cannot convert the chart (Pro) to a common chart.

Background information

A flow chart, also known as a ThemeRiver chart, is a stacked area chart around a central axis. The banded branches with different colors indicate different categorical variables. The widths of the banded branches indicate the numeric values of the categorical variables. By default, the time information of data is mapped to the X-axis. A flow chart can display data in three columns.

You can select Line Chart or Column Chart for the Chart Types parameter. If you select Column Chart, a stacked column chart is displayed. In a stacked column chart, categorical variables are stacked on top of the other in vertical columns.

Procedure

  1. Log on to the Log Service console.
  2. In the Projects section, click the name of the project that you want to manage.
  3. Choose Log Storage > Logstores and click the Logstore that you want to manage.
  4. Enter a query statement in the search box, select a time range, and then click Search & Analyze.
  5. On the Graph tab, click the Flow chart - 001 icon.
  6. On the Properties tab, configure the properties of the flow chart.
    • Area chart
      Parameter Description
      Chart Types The type of the chart. In this example, select Area Chart.
      X Axis The sequential data. In most cases, a time series is selected.
      Y Axis The value of the categorical variable. You can select one or more fields for the Y-axis.
      Aggregate Column The data that is aggregated from one or more columns and displayed as the third column.
      Chart Details Column The information that is displayed when you move the pointer over the chart.
      Legend The position of the legend in the chart. Valid values: Top, Bottom, Left, and Right.
      Format The format in which data is displayed.
      Legend Width The width of the legend.
      X-axis Scale Density The scale density of the X-axis.
      Metric Filter If you turn on Metric Filter, you can filter metrics to view specific types of data.
      Time Series Set the X-axis to a time series.
      Time Format The time format of the time series.
      Margin The distance between the axis and the borders of the chart. The parameters include Top Margin, Bottom Margin, Left Margin, and Right Margin.
    • Line chart
      Parameter Description
      Chart Types The type of the chart. In this example, select Line Chart.
      X Axis The sequential data. In most cases, a time series is selected.
      Y Axis The value of the categorical variable. You can select one or more fields for the Y-axis.
      Aggregate Column The data that is aggregated from one or more columns and displayed as the third column.
      Chart Details Column The information that is displayed when you move the pointer over the chart.
      Legend The position of the legend in the chart. Valid values: Top, Bottom, Left, and Right.
      Format The format in which data is displayed.
      Show Markers If you turn on Show Markers, the data points are displayed.
      Legend Width The width of the legend.
      X-axis Scale Density The scale density of the X-axis.
      Metric Filter If you turn on Metric Filter, you can filter metrics to view specific types of data.
      Add Line If you turn on Add Line, you can add a horizontal line to the chart.

      You can click Add Line to configure the color of the line and the value on the Y-axis.

      Time Series Set the X-axis to a time series.
      Time Format The time format of the time series.
      Margin The distance between the axis and the borders of the chart. The parameters include Top Margin, Bottom Margin, Left Margin, and Right Margin.
    • Column chart
      Parameter Description
      Chart Types The type of the chart. In this example, select Column Chart.
      Grouping If you turn on Grouping, columns are displayed by group. If you turn off Grouping, columns are stacked.
      X Axis The sequential data. In most cases, a time series is selected.
      Y Axis The value of the categorical variable. You can select one or more fields for the Y-axis.
      Aggregate Column The data that is aggregated from one or more columns and displayed as the third column.
      Chart Details Column The information that is displayed when you move the pointer over the chart.
      Legend The position of the legend in the chart. Valid values: Top, Bottom, Left, and Right.
      Format The format in which data is displayed.
      Legend Width The width of the legend.
      X-axis Scale Density The scale density of the X-axis.
      Metric Filter If you turn on Metric Filter, you can filter metrics to view specific types of data.
      Time Series Set the X-axis to a time series.
      Time Format The time format of the time series.
      Margin The distance between the axis and the borders of the chart. The parameters include Top Margin, Bottom Margin, Left Margin, and Right Margin.
    • Scatter with smooth lines and markers
      Parameter Description
      Chart Types The type of the chart. In this example, select Scatter with Smooth Lines and Markers.
      Row The first column of the chart, which contains the field that you select and the values of this field.
      Value Column The values to be displayed for the field that you select in Aggregate Column.
      Aggregate Column The data that is aggregated from one or more columns and displayed as the third column.
      Chart Details Column The information that is displayed when you move the pointer over the chart.
      Format The format in which data is displayed.
      Items per Page The number of entries to be displayed on each page.
      Disable Sorting If you turn on Disable Sorting, you can disable the sorting feature.
      Disable Search If you turn on Disable Sorting, you can disable the search feature.
      Metric Filter If you turn on Metric Filter, you can filter metrics to view specific types of data.
      Time Series Set the X-axis to a time series.
      Time Format The time format of the time series.

Example

A flow chart is suitable for displaying data in three columns, such as the time, category, and numeric value. In this example, execute the following query statement:

* | select date_format(from_unixtime(__time__ - __time__% 60), '%H:%i:%S') as minute, count(1) as c,  request_method group by minute, request_method order by minute asc limit 100000

Set the X Axis parameter to minute, the Y Axis parameter to c, and the Aggregate Column parameter to request_method.

Flow chart