Chart Configuration¶
Includes commonly used configurations and advanced configurations for charts.
Common Configurations¶
Title¶
-
Title: Set the title name for the chart. After setting, it will be displayed in the top-left corner of the chart, with an option to hide it.
-
Description: Add a description to the chart. After setting, an [i] prompt will appear after the chart title; if not set, it will not be displayed.
Based on Guance equipped with large model natural language generation capabilities, you can use the "Auto Generate" function to quickly generate titles and descriptions that match the semantics.
Unit¶
Includes general unit formats for different dimensions such as data size, time intervals, timestamps, etc. You can input custom units in the dropdown box.
Select the metrics included under the current query conditions and input custom units.
About unit display for metric data
-
Default unit display:
- If the queried data is metric data, and you have set units for the metrics in Metric Management, the default display will follow the unit settings of the metrics;
- If there are no related unit configurations in Metric Management, the numerical values will be displayed using the thousand separator with comma-separated intervals.
-
After configuring units: The custom configured units will take priority for scaling display. Metric data supports two options for numerical values:
- Default scaling: Units are in ten thousand, million, such as 10,000 displayed as 1 ten thousand, 1,000,000 displayed as 1 million. Retains two decimal places;
- Short scale: Units are K, M, B. That is, thousand, million, billion, trillion represent thousand, million, billion, trillion in Chinese context. For example, 1,000 is 1 k, 10,000 is 10 k, 1,000,000 is 1 million; retains two decimal places.
Alias¶
The system automatically lists all metrics and groupings under the current chart query. After adding aliases, the grouping part of the chart will dynamically update based on the alias value. Aliases support template variables for one-click replacement. For example:
-
{tags}
: Replaces with all "tag names" and "tag values"; -
{host}
: Replaces with the "tag value" ofhost
; -
{__name__}
: Replaces with all metric names.
Note
- The alias for the metrics section is determined by the
AS
on the right side of the query statement;
- When your query contains a by condition, it will display all legend sequences returned;
- If both the metric section and the grouping section are set in the alias, the setting precedence is: Grouping Alias > Metric Alias.
Scenario Examples¶
As shown in the figure below, querying the total CPU usage (usage_total
) and user state usage (usage_user
) of the host. Based on the former, the following scenarios may occur when setting the alias:
- Effect without adding an alias:
- Effect of replacing with plain text:
- Input variable
{tags}
based on by condition:
Legend¶
Position¶
Supports hiding, bottom, or right-side legends. Clicking on the legend's metric line can hide/display the corresponding metric.
Display Value¶
Choose the value or calculated value to display in the legend.
Time series chart legend values will undergo additional aggregation calculations based on the chart query results, supporting selection of Last (last value)
, First (first value)
, Avg (average value)
, Min (minimum value)
, Max (maximum value)
, Sum (sum)
, Count (number of points)
.
As shown in the figure below: First
indicates returning the first value of the current time series chart query result, Last
is the last value of the current time series chart query result, clicking on the legend value supports ascending/descending sorting.
Note
Avg
, Sum
, Count
display different results depending on the selected time interval (original interval and automatic alignment).
Data Format¶
-
Decimal Places: Choose 0, 1, 2, 3 decimal places or full precision.
-
Thousand Separator: Enabled by default; when disabled, the original value will be displayed without separators.
Guance dashboard chart query results support automatic addition of data thousand separator format display.
If units are set, the data format will be displayed according to the set units.
After setting, preview mode will display the data format according to the thousand separator data format. If units are set, the data format will be displayed according to the unit settings.
- Thousand separator data format display:
- Set data format display:
Advanced Configuration¶
Lock Time¶
Fixes the time range for the current chart query data, independent of the global time component. After successful configuration, the upper-right corner of the chart will display the user-defined time, such as 【xx minutes】、【xx hours】、【xx days】. Assuming a locked time interval of 30 minutes, even if the upper-right time control is adjusted, the current chart will only display data from the last 30 minutes.
Rule Mapping¶
Set the metric ranges and corresponding background colors, font colors for different columns. Metrics within the specified ranges will display according to the set styles.
Set metric ranges and mapping values, when the metric value falls within the set data range, it will display as the corresponding mapped value.
When the metric value satisfies multiple settings simultaneously, it will display as the style of the last satisfied condition.
When setting value mappings, neither the "Display As" nor the "Color" fields are mandatory:
- "Display As" defaults to empty, meaning no mapping value will be displayed;
- "Color" defaults to empty, meaning no color mapping will be applied, showing its original color.
Field Mapping¶
In practical business scenarios, if the field to be queried does not match the field displayed on the front end, you can enable field mapping in the chart. This feature works together with object mapping functionality for view variables and is off by default.
After enabling field mapping, the chart displays the grouped fields and their corresponding mapped fields. Unmapped grouped fields will not be displayed.
Space Authorization¶
Once enabled, queries for external workspace data can be performed under the current chart in the current workspace.
Below the chart, you can select the target workspace from a drop-down list of authorized workspaces for querying.
Data Sampling¶
Applicable only to Doris log data engine workspaces.
After enabling, sampling queries will be conducted for data other than "Metrics". The sampling rate is not fixed and dynamically adjusts based on data volume.
Time Offset¶
Since non-time-series data has at least a 1-minute delay after being stored in the database, selecting relative time queries may cause the most recent few minutes of data to not be collected, resulting in data loss.
After enabling time offset, when querying relative time ranges, the actual query time range shifts forward by 1 minute to prevent data retrieval issues due to storage delays. For example: if the current time is 12:30, querying the last 15 minutes of data, after enabling time offset, the actual query time is: 12:14-12:29.
Note
- This setting only applies to relative times. If the query time range is an "absolute time range", the time offset does not take effect.
- For charts with time intervals, such as time series charts, if the set time interval exceeds 1 minute, the time offset does not take effect; it only takes effect when <= 1 minute. For charts without time intervals, such as overview charts and bar charts, the time offset remains effective.