Chart Linking¶
By associating chart links, data linkage can be achieved, supporting navigation from the current chart to the target page while passing data information. The system provides the following template variables:
Variable Types¶
Supports 4 types of template variables:
Time Variables¶
Variable |
Description |
|---|---|
#{TR} |
The time range of the current chart query. For example, if the query time is Last 1 hour, the template variable &time=#{TR} is equivalent to &time=1h. |
#{timestamp.start} |
The start time of the selected data point in the current chart query. |
#{timestamp.end} |
The end time of the selected data point in the current chart query. |
#{startTime} |
When time is not locked, it is the start time of the time widget in the upper right corner of the chart. When locked, it is the start time of the locked time period. |
#{endTime} |
When time is not locked, it is the end time of the time widget in the upper right corner of the chart. When locked, it is the end time of the locked time period. |
Note
During actual query execution, time variables #{startTime} and #{endTime}, as well as view variables, can be used as placeholders. The system will replace them based on the globally set variable values.
Tag Variables¶
| Variable | Description |
|---|---|
#{T} |
The collection of all grouped tags for the current chart query. For example, if the query is:M::'datakit':(LAST('cpu_usage')) BY 'host','os'The query result is: host=abc, os=linux Then: &query=#{T} is equivalent to &query=host:abc os:linux |
#{T.name} |
The value of a specific tag. For example, if the query is:M::'datakit':(LAST('cpu_usage')) BY 'host', 'os'The query result is: host=abc, os=linux Then: #{T.host} = abc&query=hostname:#{T.host} is equivalent to &query=hostname:abc |
View Variables¶
| Variable | Description |
|---|---|
#{V} |
The collection of all view variables in the current dashboard. For example, if the view variables are: version=V1.7.0 and region=cn-hangzhou Then: &query=#{V} is equivalent to &query=version:V1.7.0 region:cn-hangzhou |
#{V.name} |
The value of a specific view variable in the current dashboard, where 'name' can be replaced with any variable name. Assume the current dashboard's view variable is version=V1.7.0 Then: #{V.version} = V1.7.0&query=version:#{V.version} is equivalent to &query=version:V1.7.0 |
Value Variables¶
| Chart Type | Variable |
Description |
|---|---|---|
| Time Series Chart Summary Chart Pie Chart Bar Chart Top List Dashboard Funnel Chart |
#{Value} |
The data value variable returned by the current chart query. For example, if the query M::cpu:(AVG(load5s)) returns: AVG(load5s)=aThen: &query=#{Value} is equivalent to &query=AVG(load5s):a |
| Scatter Plot | #{Value.X} |
The X-axis data value variable returned by the current chart query. Assume the current chart query is:M::cpu:(AVG(load5s))The query result is: X:AVG(load5s)=abc Then: &query=#{Value.X} is equivalent to &query=X:abc |
#{Value.Y} |
The Y-axis data value variable returned by the current chart query. For example, if the query M::backuplog:(AVG(lru_add_cache_success_count))returns: Y:AVG(lru_add_cache_success_count)=dca Then: &query=Y:#{Value.Y} is equivalent to &query=Y:dca |
|
| Bubble Chart | #{Value.X} |
The X-axis data value variable returned by the current chart query. For example, if the query T::RE(.*):(FIRST(duration)) BY servicereturns: X:first(duration)=98 Then: &query=X:#{Value.X} is equivalent to &query=X:98 |
#{Value.Y} |
The Y-axis data value variable returned by the current chart query. For example, if the query T::RE(.*):(LAST(duration)) BY servicereturns: Y:last(duration)=8500 Then: &query=Y:#{Value.Y} is equivalent to &query=Y:8500 |
|
#{Value.Size} |
The Size data value variable returned by the current chart query. For example, if the query T::RE(.*):(MAX(duration)) BY servicereturns: Size:Max(duration)=1773 Then: &query=Size:#{Value.Size} is equivalent to &query=Size:1773 |
|
| Table Chart | #{Value.column_name} |
The column value variable selected in the current chart, where name can be replaced with any column variable name. For example, if the query L::RE(.*):(COUNT(*)) { index = default }returns: count(*)=40813 Then: &query=#{Value.count(*)} is equivalent to &query=count(*):40813 |
| Treemap Hexbin Map World Map China Map |
#{Value.metric_name} |
The query data value variable selected in the current chart, where name can be replaced with any column variable name. For example, if the query L::RE(.*):(MAX(response_time)) { index = default } BY countryreturns: max(response_time)=16692 Then: &query=#{Value.max(response_time)} is equivalent to &query=max(response_time):16692 |