Label and Link: Difference between revisions
No edit summary |
(TK-58734) |
||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
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 [[QPR_ProcessAnalyzer_KPI_Card|KPI Card]] where the text can be defined using the expression language. | |||
To edit the label text, the [[QPR_ProcessAnalyzer_Dashboard_Designer#Editing_Dashboards|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 | 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 [[QPR_ProcessAnalyzer_Dashboard_Designer#Editing_Dashboards|Preview mode]]. | ||
When hovered, there is a tooltip showing the text, which is useful when all text doesn't fit to the available space. | |||
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. | |||
* '''Link target''': Defines a link to other dashboard (defined as the target dashboard identifier) or to an external web page. The link is identified as a external web link if it's starting with ''http://'' or ''https://''. | |||
* '''Dashboard component actions''': It is possible to have the Label and Link component either set [[Dashboard_Variables|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. The action types are: | |||
** '''SetVariable''': Sets the defined dashboard variable values. This action type supports the following field: | |||
*** '''parameters''': 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. | |||
** '''RunScript''': Runs the defined script and shows return value as popup dialog or sets dashboard variables. If the script returns a json object, the key-value pairs in the json object are set as dashboard variables. If the script returns other value than a json object, the return value is shown as a popup message. The same action parameters are supported as in the [[Actions_to_Run_Script_in_Table#Action_settings|actions to run a script in a table]]. The parameters are passed to the script and are available as variables in the script: | |||
*** '''variables''': A dictionary of dashboard variables. | |||
*** '''action''': A dictionary containing settings of the clicked action. This is used to access the action parameters. | |||
*** '''chartSettings''': A dictionary containing the dashboard component settings. | |||
:: Example of a SetVariable action: | |||
:: <syntaxhighlight lang="json" line> | |||
[ | |||
{ | |||
"type": "SetVariables", | |||
"parameters": { | |||
"ModelId": "1", | |||
"sys:dashboardIdentifier": "target1" | |||
} | |||
} | |||
]</syntaxhighlight> | |||
:: Example of a RunScript action: | |||
:: <syntaxhighlight lang="json" line> | |||
[ | |||
{ | |||
"type": "RunScript", | |||
"scriptName": "My action", | |||
"parameters": { | |||
"parameter1": "value1", | |||
"parameter2": 5 | |||
} | |||
} | |||
]</syntaxhighlight> | |||
* '''Background color''': Background color of the label area. | * '''Background color''': Background color of the label area. | ||
* '''Border color''': Border color of the label area. Note that the border is visible | * '''Border color''': Border color of the label area. Note that the border is visible when its width is not zero. | ||
* '''Border width''': | * '''Border width''': Border width of the label area. | ||
* '''Border corner radius''': Rounding of the border corners. | * '''Border corner radius''': Rounding of the border corners. |
Latest revision as of 13:10, 9 June 2025
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.
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.
- Link target: Defines a link to other dashboard (defined as the target dashboard identifier) or to an external web page. The link is identified as a external web link if it's starting with http:// or https://.
- 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. The action types are:
- SetVariable: Sets the defined dashboard variable values. This action type supports the following field:
- parameters: 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.
- RunScript: Runs the defined script and shows return value as popup dialog or sets dashboard variables. If the script returns a json object, the key-value pairs in the json object are set as dashboard variables. If the script returns other value than a json object, 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. The parameters are passed to the script and are available as variables in the script:
- variables: A dictionary of dashboard variables.
- action: A dictionary containing settings of the clicked action. This is used to access the action parameters.
- chartSettings: A dictionary containing the dashboard component settings.
- SetVariable: Sets the defined dashboard variable values. This action type supports the following field:
- Example of a SetVariable action:
[ { "type": "SetVariables", "parameters": { "ModelId": "1", "sys:dashboardIdentifier": "target1" } } ]
- Example of a RunScript action:
[ { "type": "RunScript", "scriptName": "My action", "parameters": { "parameter1": "value1", "parameter2": 5 } } ]
- 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.