Label and Link
Label component shows a static text in the dashboard, such as a title or detailed description. There are variety of settings available, such as font size, text color and bolding to customize the visual appearance of the text. If you need a changing text based on the model content, use the KPI Card where the text can be defined using the expression language.
To edit the label text, the Edit mode needs to be active. The text spans to multiple lines, if it doesn't fit to a single line. It's also possible to add line breaks to the text to have several text paragraphs.
The label can also work as a link to other dashboard or web site. When defined as a link, the label is a clickable link only in the Preview mode.
When hovered, there is a tooltip showing the text, which is useful when all text doesn't fit to the available space.
Visual settings
Label has the following visual settings:
- Font size: Size of the label text in pixels, defined in 1 pixel granularity.
- Text styles: Following visual effects for the label text can be defined: Bold, Italic, Underline, Overline and Line through. Multiple effects can be used at the same time.
- Text color: Color of the label text.
- Horizontal alignment: Horizontal alignment of the label text: Left, Centered, Right or Justified (justified means that full lines take the entire width by increasing spacing between words).
- Vertical alignment: Vertical alignment of the label text: Top, Centered or Bottom. If you want to see scrollbar in the text when the text doesn't fit to the visible screen, use the Top vertical alignment.
- Background color: Background color of the label area.
- Border color: Border color of the label area. Note that the border is visible when its width is not zero.
- Border width: Border width of the label area.
- Border corner radius: Rounding of the border corners.
Clickable link
Link target field in the Link & Label settings defines a link to another dashboard (defined as the target dashboard identifier) or to an external web page. The external link is identified as a external web link if it's starting with http:// or https://. The target dashboard opens to the same browser tab and the external web page opens to a new tab.
Dashboard component actions
It is possible to have the Label and Link component either set variable values or to run a script and have the script show the return value as a popup dialog or set dashboard variables. The configuration is done as JSON. When an action is configured, the action can be run by clicking the Label and Link component in the Preview mode. Only a single action can be configured.
Set variables action
When the action type is SetVariable, the defined dashboard variable values are set. This action type supports the parameters field which is a JSON object that defines the variables to be set. If the sys:dashboard or sys:dashboardIdentifier is among the variables, the variables are set in the session context, and otherwise in the dashboard context.
Example of a set variables action:
[
{
"type": "SetVariables",
"parameters": {
"ModelId": "1",
"sys:dashboardIdentifier": "target1"
}
}
]
Run script action
When the action type is RunScript, the defined script is run and its return value is shown as a popup dialog or dashboard variable values are set based on the result. If the script returns a json object, the variable-value pairs in the json object are set as dashboard variables. If the script returns other value than a json object (such as a string), the return value is shown as a popup message. The same action parameters are supported as in the actions to run a script in a table. See also the example scripts.
The parameters are passed to the script and are available as following script variables:
- variables: Dictionary of all dashboard variables with values when the action was started.
- action: Dictionary containing settings of the clicked action. This is used to access the action parameters.
- chartSettings: Dictionary containing the dashboard component configuration.
Example of a run script action:
[
{
"type": "RunScript",
"scriptName": "My action",
"parameters": {
"parameter1": "value1",
"parameter2": 5
}
}
]