All Products
Search
Document Center

Simple Log Service:Configure a trend chart

Last Updated:Jun 17, 2026

Trend charts display key metrics with comparison values, helping you spot changes in log data at a glance. You can add trend charts to dashboards for continuous monitoring.

Prerequisites

Overview

image

  1. Query and analyze data: Count the page views (PVs) of a webpage in the console to verify your log data.

  2. Configure a trend chart: Add a trend chart named statistical-chart, configure a comparison value, and add the chart to a dashboard.

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. In the left-side navigation pane, click Log Storage. In the Logstore list, click the target Logstore.

  3. Enter the following query and analysis statement to count webpage PVs. Then, click Search & Analyze to view the results.

    *| select diff[1] as pv, diff[2] as previous_day_pv, (diff[1] - diff[2])/diff[2] as growth
    from (
        select compare(pv, 86400) as diff 
        from (
            select count(1) as pv 
            from log
        )
    )

Step 2: Configure a trend chart

1. Add a trend chart

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

2. Configure a title

In the configuration panel on the right, choose General Configurations > Chart Type > image. Then, under General Configurations > Basic Configurations, set Title to statistical-chart.

3. Configure the trend chart

On the right side of the page, set General Configurations > Chart Style > Color Mode to Background and General Configurations > Chart Style > Image Mode to Trend Chart.

  • General Configurations > Chart Style > Color Mode: Select Background to apply a color to the background and the trend chart. The default color is green.

  • General Configurations > Chart Style > Image Mode: Displays the chart as a Trend Chart.

4. Configure a comparison value

In the configuration panel on the right, on the General Configurations tab, configure the Search & Analysis Settings. Set the time range, select the Logstore, enter your query and analysis statement, and click Apply to preview the chart.

  • General Configurations > Search & Analysis Settings > Displayed Fields: Select the pv field to display in the trend chart.

  • General Configurations > Search & Analysis Settings > Compared Field: Select the growth field, which represents the rate of change.

  • General Configurations > Search & Analysis Settings > Comparison Result Description: Enter Day-over-day as the description for the comparison value.

  • General Configurations > Search & Analysis Settings > Compare Value Format: Because the growth field represents a rate of change, set the format to percent(1-100).

  • General Configurations > Search & Analysis Settings > Number of Digits after Decimal Point: Set the number of decimal places to two.

The query statement uses the compare function to calculate day-over-day PV changes. For other settings, set trend comparison threshold to 0, number of digits after decimal point to 2, and description value font size to 23.

5. Save the trend chart and the dashboard

  1. In the upper-right corner of the statistical chart editing page, click OK.

  2. In the upper-right corner of the dashboard editing page, click Save.