Configuring Parameters for Dashboards¶
In dashboard pages, you can fill dynamic parameters into text boxes. When users switch filters, the displayed text will change dynamically along with the filter. Digital Twin Visualization supports the following types of parameters:
Page parameters: Global filter parameters configured on the page.
Widget parameters: Data source parameters configured in the widget.
Data parameters: Data field parameters configured in the widget.
Page Parameters¶
Page parameters are generated by the page’s global filter. You can use page parameters on the same page to dynamically pass in the data selected in the global filter. By using page parameters, you can configure jump URLs, display dynamic widget titles and rich text, configure color rules, and dynamically change the value of calculated fields.
Creating Page Parameters¶
Before you can start using page parameters, you need to create a global filter for it. If you only want to create page parameters, but do not want to display this global filter, you can configure it to be invisible on the page. Follow these steps:
From the toolbar of the page, move the mouse to Add and select Global Filter.
On the sidebar, select Add Filter.
In the Title box, specify a name for the global filter.
In the Key box, specify the key of your page parameter.
Leave the Visible on Pages checkbox unchecked.
Select the Accepting External Parameters checkbox.
Select Save.
Referencing Page Parameters¶
The key of the global filter is the page parameter key. Use ${parameter_key} to reference a global parameter. For example, you can reference page parameters in the following locations:
Widget Title: Enter
${parameter_key}in the Title box. For example, if the global filter’s key isplace, you can specify the title as${place} Station. When the global filter selectsBeijing, that is,place=Beijing, the title will be rendered asBeijing Station.Rich Text Widget: Enter
${parameter_key}in the text area. Alternatively, you can select Insert Field and select the parameter from the list.Calculated Field: Enter
global.<parameter_key>. You can view these parameter keys by pressing the CTRL key.
Widget Parameters¶
Widget parameters are the parameters of the data source selected within the widget, and are only supported within the same widget. The parameter key of a widget parameter is the key of the widget’s data source configuration item. Parameter values can be modified through global filters.
Viewing Widget Parameters¶
Depending on the data source, the parameter list of the data source differs for each widget. Follow these steps to view widget parameters:
In the widget editor, select 1 data source in Select Data Field.
Select Expand Parameters to view the request parameters of the data source.
Referencing Widget Parameters¶
In a widget, use the syntax
@{parameter_key}to reference a widget parameter.In a calculated field:
params.<parameter_key>.
Data Parameters¶
Data parameters are the data fields used within the widget, and are only supported within the same widget.
Viewing Data Parameters¶
The key of a data parameter is the data field ID. Follow these steps to view the data parameter key:
In the widget editor, select +Add Data Field to open the popup window.
In the list of data fields, the ID column shows the data parameter keys.
Referencing Data Parameters¶
In a widget, use the syntax #{field_ID} to reference a data parameter. If the data is an array, only the first item is returned.