You can use a line chart to visualize the results of multiple query statements. You can also configure personalized display settings on the Field Configuration tab. This topic describes how to configure a line chart.
Overview
A line chart is used to analyze the value changes of a categorical variable over a continuous time range. In most cases, the analysis is based on a specified time range. You can intuitively view value trends. In a line chart, you can view the following change characteristics of values over a specific time range:
Increment or decrement
Increment or decrement rate
Increment or decrement pattern, such as periodicity
Peak value and bottom value
Line charts are the optimal choice for you to analyze value changes over a time range. You can also use a line chart to analyze the value changes of multiple fields in multiple lines over the same time range. Then, you can analyze the relationships between the fields. For example, the values of the fields are directly or inversely proportional to each other.
For more information about the entry point to add a line chart, see Add a chart to a dashboard.
Configuration effect
Line chart type | Sample line chart | References |
Configuration example
Basic line chart
Log on to the Simple Log Service console. In the Projects section, click the project you want.
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](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/8483519271/p857236.png)
On the right side of the Edit Chart page, choose . On the left side of the Edit Chart page, enter a query statement and click Last 15 Minutes to specify a query time range.
Query Statement A:
* | select __time__,count(request_url) as pv group by __time__
![image](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/5817041371/p859794.png)
Other settings
Line chart setting | Description | Sample line chart |
Line chart setting | Description | Sample line chart |
Configure the x-axis and y-axis | You can format data on the x-axis in a line chart. This way, you can view the data within a specific time range when you access the line chart on a Simple Log Service dashboard. For example, you can view the data by hour, day, week, or month. You can configure threshold-related parameters for the y-axis. This way, you can identify abnormal values or unexpected data based on the colors that you specify for thresholds. You can configure the Maximum Value and Minimum Value parameters and the parameters in the Threshold section for the y-axis. After the configuration is complete, you can clearly identify the maximum and minimum values of data points in a line chart, identify abnormal values based on the colors that you specify for thresholds, and resolve potential issues at the earliest opportunity. This helps you monitor system performance, identify anomalies, and forecast and analyze data.
For more information, see Configure the X axis and Y axis for a line chart. | ![image](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/7132072371/p863134.png)
|
Configure aliases and colors for a multi-axis line chart | You can configure aliases and colors for a multi-axis line chart. This way, you can differentiate and quickly identify data series. In a multi-axis line chart, multiple lines represent different data series. If you do not configure aliases and colors for the lines and a large number of data series exist, the data series are difficult to differentiate. For more information, see Configure aliases and colors for a multi-axis line chart. | ![image](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/7132072371/p863140.png)
|
Configure chart type settings for a multi-axis line chart | In a multi-axis line chart, you can use points, lines, and columns to represent data. Point: In most cases, points are used to identify specific data values. You can set the Chart Configurations > Chart Type parameter to Point to clearly display specific data values and the differences between data values. Line: In most cases, lines are used to show the trends of data. You can set the Chart Configurations > Chart Type parameter to Line to display the trends of metrics or variables over time. You can monitor the trends of data and the relationship between trends. Column: In most cases, columns are used to display the comparison of data. You can set the Chart Configurations > Chart Type parameter to Column and configure attributes such as the height and width of a line chart to represent the values of metrics. You can intuitively view the differences among metrics.
For more information, see Configure chart type settings for a multi-axis line chart. | ![image](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/7132072371/p863143.png)
|
Configuration on the General Configurations tab
You can configure global settings for a line chart on the General Configurations tab.
Parameters in the Basic Configurations section
Parameter | Description |
Title | The title of the line chart. |
Display Title | If you turn on Display Title, the title of the line chart is displayed. |
Display Border | If you turn on Display Border, the borders of the line chart are displayed. |
Display Background | If you turn on Display Background, the background color of the line chart is displayed. |
Display Time | If you turn on Display Time, the query time range of the line chart is displayed. |
Fixed Time | If you turn on Fixed Time, the query time range of the line chart is independent of the global time range of the dashboard. |
Parameters in the Standard Configurations section
Parameter | Description |
Format | The display format of numeric values. |
Unit | The unit of numeric values. |
Number of Digits after Decimal Point | The decimal places of numeric values. |
Display Name | The name of the legend. If you specify a value for the Display Name parameter, the value is used as the name for all items in the legend that is displayed in the line chart. If you want to change the name of an item in the legend, you can configure parameters on the Field Configuration tab. |
Color Scheme | The color scheme that specifies the background color and legend colors of the line chart. Valid values: |
Parameters in the Query and Analysis Configurations section
Parameter | Description |
Axis X Field | The field that you want to use as the x-axis. By default, Simple Log Service automatically selects a field as the x-axis. |
Axis Y Field | The field that you want to use as the y-axis. By default, Simple Log Service automatically selects a field as the y-axis. |
Parameters in the Data Configuration section
Parameter | Description |
Data Completion | If you turn on Data Completion, Simple Log Service automatically replaces missing values with a specified value from the first data record within the time window specified by the Completion Window parameter. |
Completion Window | The time window of data for which Simple Log Service automatically replaces missing values with a specified value. Minimum value: 10. Unit: seconds. By default, Simple Log Service automatically specifies the value of the Completion Window parameter. |
Text-substituted Value | The value that you want to use to replace missing values. Default value: 0, which indicates that Simple Log Service replaces missing values with 0. |
Parameters in the Legend Configurations section
Parameter | Description |
Display Legend | If you turn on Display Legend, the legend of the line chart is displayed. |
Legend Position | The position of the legend in the line chart. |
Actions | The data display effect when you click a legend item. Valid values: Single: If you click a legend item, only the data for the legend item is displayed in the line chart. Switch: If you click a legend item, the data for the legend item is hidden or displayed in the line chart.
|
Maximum Width (Height)% | The maximum width and height of the legend. |
Parameters in the Tooltip Configurations section
Parameter | Description |
Sorting Order | The sorting method of data. |
Display Mode | |
Additional Information | The additional information. You can add additional information for each query statement. You can add ${{field}} in the additional information to reference the field in the query statement. |
Parameters in the Axis X section
Parameter | Description |
Display Axis X | If you turn on Display Axis X, the x-axis of the line chart is displayed. |
Axis X Title | The title of the x-axis. |
Axis X Height | The height of the x-axis. By default, Simple Log Service automatically specifies the height of the x-axis. |
Format | The format of the time on the x-axis. |
Drag and Zoom | |
Parameters in the Axis Y section
Parameter | Description |
Display Axis Y | If you turn on Display Axis Y, the y-axis of the line chart is displayed. |
Axis Y Title | The title of the y-axis. |
Axis Y Position | The position of the y-axis. |
Stacking | If you set the Stacking parameter to Yes, the data on the y-axis is stacked. |
Axis Y Width | The width of the y-axis. By default, Simple Log Service automatically specifies the width of the y-axis. |
Maximum Value | The maximum value of the y-axis. By default, Simple Log Service automatically specifies the maximum value of the y-axis. |
Minimum Value | The minimum value of the y-axis. By default, Simple Log Service automatically specifies the minimum value of the y-axis. |
Elastic Maximum Value | The elastic maximum value of the y-axis. The elastic maximum value takes effect only when all values of the y-axis are less than the elastic maximum value. By default, Simple Log Service automatically specifies the elastic maximum value of the y-axis. |
Elastic Minimum Value | The elastic minimum value of the y-axis. The elastic minimum value takes effect only when all values of the y-axis are greater than the elastic minimum value. By default, Simple Log Service automatically specifies the elastic minimum value of the y-axis. |
Axis Y ID | The ID of the y-axis. If you configure only one y-axis on the General Configurations tab, this parameter does not take effect. If you want to configure multiple y-axes, you must configure the required parameters on the Field Configuration tab. The ID of the y-axis is a string. A y-axis that has a specified ID represents a unique y-axis in a line chart. For more information, see Create a line chart with multiple y-axes. The specified ID for the y-axis takes precedence over the unit that you specify in the Standard Configurations section. For example, if two y-axes have the same unit, they are merged into one y-axis. If two y-axes have the same unit but different IDs, they are displayed as two y-axes. |
Parameters in the Chart Configurations section
Parameter | Description |
Chart Type | The type of the line chart. |
Connection Mode | The connection mode of the lines in the line chart. |
Line Width | The width of the lines. |
Display Point | Specifies whether to display points in the line chart. |
Transparency | The transparency of the line chart. |
Point Size | The size of the points in the line chart. |
Gradient Mode | The gradient mode of the line chart. Valid values: Transparency: If you select this mode, the line chart uses a color gradient that is affected by the line color and the value of the Transparency parameter. No Gradient: If you select this mode, the line chart does not use a color gradient. The line color is used in the line chart.
|
Parameters in the Threshold section
Parameter | Description |
Upper Boundary | The upper boundary. |
Lower Boundary | The lower boundary. |
Boundary Fill Color | The fill color between the upper and lower boundaries. |
Boundary Fill Color Opacity | The transparency of the color between the upper and lower boundaries. |
Parameters in the Variable Replacement section
Parameter | Description |
Variable Replacement | The settings for variable replacement. You can click AddVariable Replacement to add a filter of the Variable Replacement type to the table. After you configure the settings for variable replacement on the General Configurations tab, Simple Log Service adds a filter in the upper-left corner of the table. You can select a value from the filter drop-down list. Then, Simple Log Service automatically replaces the variable in the query statement of the table with the variable value indicated by the value that you select, and performs a query and analysis operation. For more information, see Example 2: Configure variable replacement. |
Parameters in the Documentation section
Parameter | Description |
Add Documentation Link | The button that allows you to specify custom document links and descriptions. After you configure the settings, the specified information is displayed in the upper-right corner of the line chart. |
Configuration on the Field Configuration tab
You can configure personalized display settings for the results of a single query statement or for a single column of data in the results. For more information, see Configuration on the General Configurations tab.
For example, you can select A > pv to configure settings for the pv field in the results of Query Statement A. In the B section, you can configure settings for the results of Query Statement B. In the following figure, the green line indicates the pv field in the results of Query Statement A and the blue line indicates the results of Query Statement B. You can set the Line Width parameter to 6 for the green line and 2 for the blue line.
![字段配置](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/3559046561/p349051.png)
Configuration on the Interaction Occurrences tab
You can configure an interaction occurrence for a single field or the results of a single query statement to analyze data in a finer-grained manner. Supported types of interaction occurrences include Open Logstore, Open Saved Search, Open Dashboard, Open Trace Analysis, Open Trace Details, and Create Custom HTTP URL. For more information, see Interaction occurrences.
For example, you can select A > pv to configure an Open Logstore interaction occurrence for the pv field in the results of Query Statement A. After you configure the interaction occurrence, you can click a point on the green line of the line chart and click Open Logstore. Then, you are navigated to the Logstore that you specify.
![表格pro](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/3559046561/p349057.png)
Sample line chart (Line specified for the Chart Configurations > Chart Type parameter)
For more information about the color settings of fields, see Configuration on the Field Configuration tab.
* | select __time__ - __time__ % 60 as time, COUNT(*) as line1, COUNT(*) -20 as line2, COUNT(*) - 40 as line3 GROUP BY time order by time limit 100
![image](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/7132072371/p856549.png)