Rich Text
Rich text controls are a common type of control used to display text information and user attribute information, serving as an auxiliary analysis function in data analysis.
Common use cases for rich text include:
- Display only plain text information.
- Display dataset fields, metrics, parameters, etc., in rich text.
- Use rich text to display user attribute-related information.
- Write code in rich text to display data information.
- Use rich text for placeholders when laying out dashboards.
Rich Text Creation
When creating a rich text, clicking the rich text control icon on the page will take you to the rich text editing page.
The process of creating rich text is divided into two steps: first, edit the content of the rich text, and then adjust the style of the rich text content.
Rich Text Content
Rich text content includes:
Plain text information. Add plain text information in the rich text editing box to display the text content.
Use dataset fields, metrics, parameters, and user attributes as rich text content. Directly click the field name on the left to add it to the rich text.
- Add rich text content using functions. Select a function from the function list for editing, as shown in the figure.
When using functions, it is important to note:
- If the function parameters do not include fields from the dataset, calculations cannot be performed. This is because the system cannot identify which database function to call for the calculation. For example, using functions like
TODAY()
orNOW()
directly will not yield the expected results. - When adding a function, a code snippet is automatically added. When writing code manually, you need to add the code snippet manually.
- Rich text supports inserting time.
Tip
The time inserted in rich text is static. If you want to display dynamic time, use time functions such as TODAY(), NOW(). Add functions like TODAY(), NOW() to the dataset fields, and reference the corresponding fields in the rich text to achieve dynamic time.
Rich Text Content Styles
Supports styling rich text content, including:
- Content Style. Adjust the font, size, color, line spacing, bold, italic, underline, and strikethrough of the content.
- Content Layout. Content can be adjusted to the left, center, or right in both horizontal and vertical directions.
- Content Arrangement. Supports ordered and unordered arrangements.
Rich Text Control Settings
Rich text control settings allow for rich text appearance settings. For detailed settings, see Control Appearance.
The rich text control supports the following interactive operations:
- Execute JS Code Execute specified JS code operation when clicking on rich text. For setup method, refer to Related Link.
- No Response Refers to no response when clicking on rich text.
- Jump Jump to the set dashboard or URL when clicking on rich text. For jump-related settings, refer to the Jump section in control settings.
- Scroll To Scroll to the specified control when clicking on the rich text control.
- Control Container Switch to the specified container tab when clicking on the control, as shown in the example, a container with two tabs, switching tabs within the container via rich text.
Tip
Button Control also supports scrolling to and controlling containers. Unlike rich text, the same button can simultaneously achieve both scrolling to and controlling container interactions, while rich text can only perform one of these interaction operations.