Statistical chart

更新时间:
复制 MD 格式

A statistical chart is a visualization tool in Log Service that intuitively displays data distribution and trends. You can configure a single value chart or integrate the results from multiple Search & Analysis queries into a single statistical chart. This topic describes the basic configurations for a statistical chart.

Overview

A statistical chart can contain one or more single value charts. A single value chart highlights a single numeric value. For example, in the image below, each colored block represents a single value chart.

统计图Pro版本

To learn how to add a chart to a dashboard, see Add a chart to a dashboard.

Examples

Chart type

Example

Related links

Basic statistical chart

image

Configure a basic statistical chart

Trend chart

image

Configure a trend chart

Thresholds

ff454563dcdb0fb734205803218743e8 2aed352e908ee1c0236c225531159aa8

Set thresholds for a statistical chart

Multiple queries

image

Configure a statistical chart with multiple queries

Basic statistical chart configuration

  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, 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.

  3. On the right side of the page, configure Chart Types and Search & Analysis Settings. On the left side, configure the query time range, logstore, and query statement. Then, click Apply at the top of the page to view the results.

    For this example, set Chart Types to Single Value Chart Pro, set Query Time Range to 15 Minutes (Relative), select website_log as the Logstore, and in the Search & Analysis Settings section, select PV for Displayed Fields.

    The query statement to count page views (PVs) is:

    status < 400 | SELECT count(*) AS PV

General configurations

These settings apply to the entire statistical chart.

  • Basic configurations

    Parameter

    Description

    Title

    The title of the statistical chart.

    Display title

    After you turn on the Show Title switch, the title is displayed on the statistical chart.

    Display border

    After you turn on the Show Border switch, a border is displayed in the statistical chart.

    Display background

    After you turn on the Display Background switch, a background color is displayed in the statistical chart.

    Display time

    After you turn on the Show Time switch, the query time is displayed in the statistical chart.

    Fixed time

    When you turn on the Fixed Time switch, the time for Search & Analysis is fixed and is not affected by the dashboard's global time.

  • Standard configurations

    Parameter

    Description

    Format

    The display format for numeric values.

    Unit

    The unit for numeric values.

    Number of decimal places

    The number of decimal places to display for numeric values.

    Display name

    The display name for the single value chart.

    Sets a display name for all single value charts in the statistical chart. To override this name for a specific chart, use the Field Configuration options.

    Color scheme

    The color scheme for the chart's background.

    • Built-in: Use the built-in color scheme.

    • Solid: Select a single color.

    • Threshold: Color the chart based on the configured thresholds.

  • Data configuration

    Parameter

    Description

    Display mode

    The mode for displaying data in a single value chart.

    • Calculation Result: Displays a single value aggregated from the query results by using the selected function.

    • All Values: Displays all values from the target column in the query results.

    Function

    Available when Display mode is Calculation Result. The function used to aggregate the query results.

    For example, if you select Maximum Value, the chart displays the maximum value found in the results.

    Limit

    When you set Display Mode to All Values, you can use Number of Values to limit the number of values displayed in the statistical chart.

    Layout

    The arrangement of the single value charts.

    • Automatic: The layout is adjusted automatically.

    • Horizontal: Arranges the charts from left to right.

      You can also set a minimum width for the charts.

    • Vertical: Arranges the charts from top to bottom.

      You can also set a minimum height for the charts.

  • Chart style

    Parameter

    Description

    Text mode

    Controls the text elements displayed on a single value chart.

    • Auto: Automatically determines what to show based on the results.

    • Value: Displays only the value, not the title.

    • Value and Title: Displays both the value and the title.

    • Title: Displays only the title, not the value.

    • None: Displays no text content.

    Title font size

    The font size for the chart title.

    Value font size

    The font size for the chart value.

    Color mode

    The color of the chart elements.

    • None: No color is applied.

    • Value: Colors the value or the trend chart.

    • Background: Colors the background or the trend chart.

    Background color

    The background color to apply when Color mode is set to Background.

    Font color

    The font color to apply when Color mode is set to Value.

    Image mode

    Specifies whether to display a trend chart.

    • None: Hides the trend chart and displays only the value.

    • Trend Chart: Displays the trend chart.

    Text alignment

    The alignment of the text.

    • Auto: Text is aligned automatically.

    • Center: The value is centered.

  • Search & Analysis settings

    Parameter

    Description

    Displayed fields

    The field to display in the single value chart.

    Description field

    Adds a description to each value in the trend chart.

    Comparison field

    The field to compare with the displayed field.

    Comparison value format

    The display format for the comparison value.

    Comparison value description

    The description for the comparison value.

    Comparison value unit

    The unit for the comparison value.

    Trend comparison threshold

    The threshold for the trend comparison.

    Number of decimal places

    The number of decimal places for the value.

    Description font size

    The font size for the description content.

  • Thresholds

    Parameter

    Description

    Thresholds

    The thresholds for the data.

    If you set Color scheme to Threshold and define thresholds here, the chart text is colored based on its value relative to these thresholds.

  • Value Mapping

    Parameter

    Description

    Value mapping

    Replaces values in the statistical chart with words or icons.

    For example, if you set Value to 200, set Mapping Type to Text, and set Mapping Value to Success, then 200 in the statistical chart is displayed as Success.

  • Variable substitution

    Parameter

    Description

    Variable substitution

    Variable substitution adds a variable-type filter to the chart. After configuration in General configurations, a filter appears in the upper-left corner of the chart. When you select a value, Simple Log Service replaces the variable in the query statement and reruns the analysis. Example 2: Set variable substitution.

  • Documentation links

    Parameter

    Description

    Add documentation link

    Adds custom documentation links or descriptions. The information is displayed in the upper-right corner of the chart.

Field configuration

Field Configuration customizes the visualization settings for the results of a single Search & Analysis query or for a specific column in those results. For details about the configuration options, see General configurations.

For example, you can add five queries (A, B, C, D, and E) to count requests for different HTTP methods and display them in a statistical chart. You can use the General configurations > Search & Analysis settings to generate five single value charts. Then, in the Field Configuration section, you can set a different color for each single value chart. The resulting chart is shown below:

  • A > GET: Configures the GET column from query A. The corresponding single value chart is set to purple.

  • B > POST: Configures the POST column from query B. The corresponding single value chart is set to blue.

  • C > PUT: Configures the PUT column from query C. The corresponding single value chart is set to orange.

  • D > D: Configures the D column from query D. The corresponding single value chart is set to yellow. Because DELETE is a reserved keyword in SQL and cannot be used directly in a query statement, you can use the Display name option here to rename the column to DELETE.

  • E > HEAD: Configures the HEAD column from query E. The corresponding single value chart is set to red.

Interaction events

Interaction events let you configure interactive options for the results of a query or for a specific data column, enabling deeper drill-down analysis. Supported events include Open logstore, Open Saved Search, Open dashboard, Open Trace Analysis, Open Trace Details, and Create Custom HTTP URL. For more information, see Add interaction events to a dashboard for drill-down analysis.

For example, A > PV indicates that you are setting up an interaction event for the PV field from query A. If you set the event for the PV field to Open logstore, you can click the PV value on the statistical chart and then click Open logstore to navigate to the specified logstore.