All Products
Search
Document Center

Simple Log Service:Configure a trend chart

Last Updated:Dec 01, 2025

This topic describes how to configure a trend chart to analyze log data trends.

Prerequisites

Overview

image

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

  2. Configure a trend chart: Add a trend chart named statistical-chart, configure a comparison value for it, and then add the chart to the target 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 navigation pane on the left, click Log Storage. In the Logstores list, click the target Logstore.

    image

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

    *| 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 navigation pane on the left, choose Dashboard > Dashboards. In the Dashboard list, click the dashboard that you want to manage. In the upper-right corner of the dashboard, click Edit. In edit mode, choose Add > Add Chart.

image

2. Configure a title

On the right side of the page, choose General Configurations > Chart Types > image. Then, under General Configurations > Basic Configurations, set Title to statistical-chart.

image

3. Configure the trend chart

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

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

  • General Configurations > Chart Style > Image Mode: The statistical chart is displayed as a Trend Chart.

image

4. Configure a comparison value

On the General Configurations tab in the right-side panel, configure the Search & Analysis Settings. On the left side of the page, configure the query time range, Logstore, and query and analysis statement. Then, click Apply at the top of the page to view the chart.

  • General Configurations > Search & Analysis Settings > Displayed Fields: Select the PV field from query A to display it in the trend chart.

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

  • General Configurations > Search & Analysis Settings > Comparison Result Description: Enter compared to yesterday as the description for the comparison value.

  • General Configurations > Search & Analysis Settings > Compare Value Format: Set the display format for the comparison value to percent(1-100) because the growth field represents a rate of change.

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

image

5. Save the trend chart and the dashboard

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

    image

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

    image