Configure chart types

更新时间:
复制 MD 格式

Configure line charts, area charts, column charts, and cross tables for a flow chart in Simple Log Service.

Prerequisites

Overview

To configure a flow chart, complete these three steps: query and analyze data, add a chart to a dashboard, and set the chart type.

  1. Search & Analysis: Query and analyze logs in the console — search, aggregate, and perform statistical analysis.

  2. Add a chart: Add a chart to a dashboard. Each chart is based on one or more query and analysis statements.

  3. Configure a chart type (line chart, area chart, column chart, or cross table)

Step 1: Query and analyze data

  1. Log on to the Simple Log Service console. In the Projects section, click the project you want.

    image

  2. On the Log Storage > Logstores tab, click the logstore you want.

    image

  3. Enter a query and analysis statement and click Last 15 Minutes to specify a time range.

    Example:

    • * | select __time__,count(0) as pv group by request_method,__time__

Step 2: Add a chart

  1. In the left-side navigation pane, choose Dashboard > Dashboards. In the Dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, choose Add > Add Chart.

    image

  2. Under General Configurations > Chart Types > image. On the Search & Analysis tab, select LogStore (SQL), select the target Logstore, and enter a query statement.

    From the drop-down list in the upper-right corner, select a time range, such as Last 15 Minutes. Click OK > Save.

    • In the Query and Analysis Configurations section, set Axis X Field to __time__ and Axis Y Field to pv.

    By default, the x-axis field __time__ is in the UNIX time format. To format the time for readability, enable Time Series Mode and set the Format option for the x-axis to YYYY-MM-DD hh:mm:ss. Time Series Mode.

Step 3: Configure the chart type

Line chart

To display the pv field as a line chart, select Flow Chart Configurations > Flow Chart Type > Line Chart.

Area chart

To display the pv field as an area chart, select Flow Chart Configurations > Flow Chart Type > Area Chart.

Column chart

To display the pv field as a column chart, select Flow Chart Configurations > Flow Chart Type > Column Chart.

Cross table

To display the pv field as a cross table, select Flow Chart Configurations > Flow Chart Type > Cross Table.