All Products
Search
Document Center

Simple Log Service:Grouped column chart and stacked column chart

Last Updated:Dec 02, 2024

This topic explains how to set grouped column charts and stacked column charts.

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. Enter the query and analysis statement, and set the time range for your query and analysis, such as Last 15 Minutes.

    In the following example, the approx_distinct function estimates the count of unique IP addresses for each URL:

    * | select request_url, COUNT(*) as pv, approx_distinct(remote_address) as uv GROUP BY request_url ORDER BY uv

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, then enter the query statement. Select a time range, such as Last 15 Minutes, and click OK > Save.

    : Choose request_url as the X-axis, and choose uv and pv as the Y-axis.

    image

Step 3: Set stacking and color for the grouped column chart

Set the stacked column chart

In the Column Settings section, set Stacking to Yes.

Set different colors for the grouped column chart

In the Standard Configurations section, set Color Scheme to Solid, and then set the display colors for the fields pv and uv.

image