Set aliases and colors for multi-axis charts

Updated at:
Copy as MD

Multi-axis charts display multiple metrics on a single dashboard. Assign a unique alias and color to each metric for easy identification.

Prerequisites

Overview

In the field configuration panel of a Simple Log Service chart, set the display names for the fields A > pv, A > pv1, and A > pv2 to standard, min, and max, respectively. The chart legend displays these aliases, making it easy to distinguish the three time-series lines.

  1. Query and analysis: You can query and analyze logs in the console, for example, by performing log searches, log aggregation, and statistical analysis.

  2. Add a chart: A dashboard consists of multiple charts, and each chart uses one or more query and analysis statements.

  3. Set aliases and colors for a multi-axis chart: Assign different aliases and colors to the fields on the y-axis.

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 set the time range for the query.

    Example:

    • The following is an example of a query and analysis statement:

      * | select __time__,count(request_url) as pv,count(request_url)-50 as pv1,count(request_url)+50 as pv2 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, choose Add > Add Chart.

    image

  2. Under General Configurations > Chart Type. On the Query and Analysis tab, select Logstore (SQL) (a Logstore is used in this example), choose the target Logstore, and enter the query statement.

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

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

Step 3: Set aliases and colors

Set aliases

Under Standard Configurations > Display Name option to assign an alias for each y-axis field.

For example, set the display names for the fields A > pv, A > pv1, and A > pv2 to standard, min, and max, respectively. The chart legend then displays these aliases to distinguish the three time-series lines.

Set colors

Navigate to Standard Configurations > Color Scheme > Solid to set a unique color for each field on the y-axis.

On the Field Configurations tab, select each data field, such as A > pv, A > pv1, and A > pv2, and then configure a color for each.