All Products
Search
Document Center

Simple Log Service:Configure the X axis and Y axis of a line chart

Last Updated:Nov 12, 2024

This topic explains how to configure the X axis and Y axis of a line chart.

Prerequisites

Step 1: Query and analyze data

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

  2. In the left-side navigation pane, click Log Storage. In the Logstores list, click the logstore you want.

    image

  3. Input the query and analysis statement and click Last 15 Minutes to define the time range for the query and analysis.

    Example:

    * | select __time__,count(request_url) as pv group by __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, click Add > Add Chart.

    image

  2. On the General Configurations tab, click image in the Chart Types section. On the Search & Analysis tab, select Logstore (SQL) and choose the logstore you want, and enter the query statement. Select a time range, such as Last 15 Minutes, and click OK > Save.

    • Query and Analysis Configurations: Set Axis X Field to __time__, and Axis Y Field to pv.

    image

Step 3: Configure the X axis and Y axis

Configure the X axis

Show or hide the X axis

Axis X > Display Axis X: Set Display Axis X to display or hide the axis X on the chart.

image

Format the X axis

Axis X formatting is available only in time series mode. The following figure shows the Time Series Mode switch and the time formatting settings:

image

Configure the Y axis

Show or hide the Y axis

Axis Y > Display Axis Y: Set Display Axis Y to display or hide the Y axis on the chart.

image

Maximum and minimum values

The following figure shows how to define the maximum and minimum values for the Y axis:

image

Set multiple line charts

Update the query statement to: * | select __time__, count(request_url) as pv, count(request_url)-50 as pv1, count(request_url)+50 as pv2 group by __time__.

Query Analysis Configurations > A > Axis Y Field: Select the fields pv, pv1, and pv2.

image

Set thresholds

Threshold: Assign pv2 as the Upper Boundary and pv1 as the Lower Boundary. Select red as the Boundary Fill Color.

image