Ticker board

更新时间:
复制 MD 格式

A ticker board displays values, counts, or time. It can interact with other widgets to show real-time data changes. This topic explains how to use the ticker board widget.

Widget overview

Scenarios

Ticker boards are used for clocks, timers, and counters. In finance, they display monetary amounts. Businesses use them to show key metrics. For example, you can display a business metric to quickly identify operational issues by observing its changes.

Demonstration

A ticker board usually consists of a title, a prefix or suffix, and the ticker content. The following example uses a ticker board to show the daily sales amount for a region.

image

Limits

The ticker board content only supports the Number type. If your data is not a Number type, the platform treats the content as an abnormal character and automatically replaces it with specified content. For more information, see Abnormal character processing.

Prerequisites

Add a ticker board

  1. Log on to the DataV console.

  2. On the Workbench page, in the Data Dashboards area, hover over the target dashboard and click Edit. The canvas editor opens.

  3. In the navigation pane on the left, under Component Library > Information, click the Ticker Board widget to add it to the canvas.

You can also add the widget using the global search feature.

Connect to business data

After you add the widget, connect your business data to it. Click the ticker board. On the Data Source tab on the right, select the data for the widget.image

  • The following table describes the data fields that the ticker board accepts.

    Field

    Description

    name

    (Optional) The title of the ticker board. If not empty, this value overwrites the configuration in the Style tab. If empty, the content in the Style > Basic Style > Title Content field is used.

    value

    The specific numeric value for the ticker board.

    prefix

    (Optional) The prefix for the ticker board. If not empty, this value overwrites the configuration in the Style tab. If empty, the content in the Style > Ticker Board > Prefix Content field is used.

    suffix

    (Optional) The suffix for the ticker board. If not empty, this value overwrites the configuration in the Style tab. If empty, the content in the Style > Ticker Board > Suffix Content field is used.

    The following code shows an example data structure and the resulting ticker board.

    [
     {
     "name": "This is the title",
     "value": 232425
     }
    ]

    image

  • This section describes the core configuration items for the data source.

    Configuration

    Description

    Select Data Source

    Supports various data types, such as CSV files, APIs, and different databases. For more information, see Supported data source types. Edit data fields in a visual table or in code.

    Configure Filter (Optional)

    Customize filter code to transform, filter, display, and perform simple calculations on data. For more information, see Manage data filters.

    Configure Data Mapping

    Map fields from the selected data source to the widget's fields. This enables real-time data matching. Click the image icon to configure field styles.

    View Response Result

    Displays the data connected to the widget in real time. When the widget's data source changes, this section shows the latest data.

    • Click the data response result to view the data field code.

    • Click View Example to see the array type and sample code that the data source accepts. You can write your fields based on the example.

    Other data request configurations:

    • Disable Loading State: If you check this box, the widget's initial loading content does not appear when the widget updates or when you preview the data dashboard.

    • Controlled Mode: If you check this box, the widget does not request data when it initializes. Data requests can only be started by the blueprint editor or by global variable events.

    • Auto Update Request: If you check this box, the platform polls for data updates at the interval you set. If you do not check this box, you must refresh the page manually or use the blueprint editor or global variable events to trigger data updates.

Configure the ticker board

Style configuration

You can configure the ticker board's style in two modes: basic and full. You can switch between modes at the top of the Style tab. Basic mode includes only color and text settings. Full mode offers more comprehensive options. This topic describes the full configuration settings.

Note
  • You can also click the image icon and search for keywords to quickly find a configuration. The search supports fuzzy matching. For more information, see Search for configuration items.

  • The title, prefix, and suffix can also be set in the data source. The platform prioritizes the data source settings. If the data source fields are empty, the style settings are used.

The following describes the relevant configuration items.

Configuration

Description

Illustration

Global Configuration

Defines the widget's position, transparency, and interaction passthrough in the data dashboard.

  • Opacity: The smaller the value, the more transparent the widget. The value ranges from 0 to 1.

  • Interaction Passthrough: If you turn this on, mouse events pass through the widget. This is useful when many widgets are on the dashboard and you need to interact with widgets in lower layers.

image

Basic Style Configuration

Defines the size, color, and shadow effect of the title text, the relative position and spacing between the title and the ticker board, and the automatic font size adjustment for the ticker board. It also supports customizing the display content during initialization and when abnormal characters appear.

  • Automatic Font Size: If you turn this on, manual settings for width, height, and spacing are ignored. The platform automatically adjusts these styles based on the font size you set.

  • Initialization Character: The value displayed when the widget initializes. This corresponds to the value field in the data source.

  • Abnormal Character: If the value from the data source is not a Number, the platform treats it as an abnormal character. The ticker board then displays the value set in the Abnormal Character parameter.

image

Ticker Board Configuration

Defines the overall layout of the ticker board content (including numbers, prefixes, and suffixes), the style and layout of the numbers, and the font style and shadow effects of the prefixes and suffixes.

Number configuration details:

  • Font: Only fonts installed on the system are supported. For more information about fonts, see Font library.

  • Layout: Set the spacing, width, and height of the numbers, and the width of the separator.

    • If the number spacing, height, and width are set to 0, the system automatically adapts them.

    • Turn on Fixed-width Separator to use a default fixed-width separator. This makes the data display clearer.

  • Background: Set the background and border styles for the ticker board's numbers and separators. You can also upload a local image as the background.

    Note

    If the number color is a gradient, the background setting has no effect.

  • Number of Digits: Set how many digits the ticker board displays, including decimal places. The platform automatically adds separators and decimal points based on your configuration.

    • If the number of digits is 0, the system automatically adapts it.

    • Turn on data rounding to display the value as a rounded integer. If turned off, the original value is displayed.

    Note

    If the configured number of digits is less than the actual data length, the leading digits are omitted. If it is greater, the number is padded with leading 0s.

  • Separator: Set the thousands separator and the decimal separator.

    Note

    The separator can be at most one character long. If it is longer, only the first character is used. Numbers cannot be used as separators.

image

Interaction Configuration

Sets the animation effects, such as animation duration and data jitter correction, and the cursor style for the ticker board.

  • Data Jitter Correction: If you turn this on, the ticker board value will only increase. If turned off, the value can increase or decrease.

  • Hand Cursor: If you turn this on, the mouse cursor becomes a hand pointer when you hover over the widget in preview mode.

image

Advanced configuration

You can define interactions and data transfer between the ticker board and other widgets. The following table describes the configurations.

Configuration

Description

Legend

Interaction Event

Define interaction behaviors with other widgets to enable widget filter interaction. For example, you can use a ticker board to connect to a sales data table for multiple stores in the current region. When the store sales data changes, the ticker board displays the total daily sales amount for the current region in real time.

Click the image icon to define relevant interaction occurrences and actions.

image

Associate Global Variable

Associate global parameters with the widget to pass data between widgets. Click the image icon to enable an instruction and associate a global variable with it.

Blueprint interaction

You can use the blueprint editor to visually define interactions and logic between widgets by connecting nodes.

Procedure

  1. In the canvas editor, click the image icon on the left side of the top menu bar to open the blueprint editor.

  2. In the layer node list, hover over the ticker board widget and click the image icon to add the widget to the main canvas.

  3. You can use connections to configure the blueprint interaction effects for the relevant widgets as needed.

    The following figure shows an example.image

Configuration description

The following describes the related interaction occurrences and actions.

Category

Subcategory

Description

Event

When data is updated

This event is triggered when the widget data is updated.

When data request status changes

This event is triggered when the data request status changes. Status values include Loading, Success, and Error.

When current value changes

This event is triggered when the current numeric value changes. It also outputs the corresponding data item. The following code shows a data example.

{
  "value": "23"
}

When the Ticker Board Is Clicked

This event is triggered when the ticker board is clicked. It also outputs the corresponding data item. The following code shows a data example.

{
  "value": "23"
}

Event

Import Data

Data is processed in the component's drawing format and imported into the component, which is then redrawn. This process does not require a new request to the server-side. An example is provided below.

[
  {
    "name": "Q3 Revenue",
    "value": 283699,
    "prefix": "¥",
    "suffix": "CNY"
  }
]

Request Data

Re-requests data from the server. Data passed from upstream data processing nodes or layer nodes is used as parameters. For example, if the API data source configured for the ticker board is https://api.test and the data passed to the Request Data action is { id: '1'}, the final requested API endpoint is https://api.test?id=1.

Reset Current Value

Resets the current number to zero. No parameters are required.

Move

Moves the widget to a specified position. The following code shows a data example.

{ 
  // Movement type. Absolute positioning: to, relative positioning: by. Default: to.
    "positionType": "to",
  // Specified position. x-coordinate, y-coordinate.
  "attr": {
   "x": 0,
   "y": 0
   },
  // Animation method.
  "animation": {
    "enable": false,
    // Animation duration.
   "animationDuration": 1000,
    // Animation curve. Optional values: linear|easeInOutQuad|easeInOutExpo.
   "animationEasing": "linear"
  }
}

Toggle Visibility

Toggles the widget's visibility between shown and hidden. The following code shows a data example.

{
  "animationType": "fade",
  "animationDuration": 1000,
  "animationEasing": "linear"
}
  • animationType: The animation method. You can set this to appear (appear/disappear), fade (fade in/fade out), or slideToUp (fly in/fly out). If not configured, there is no animation.

  • animationDuration: The animation duration. The default is 1000 ms.

  • animationEasing: The animation curve. You can set this to linear (constant speed), easeInOutQuad (smooth), or easeInOutExpo (slow-fast-slow).

Show

Hide

Update Widget Configuration

Dynamically updates the widget's style configuration.

  1. On the widget's Style panel, click Copy Configuration to Clipboard to get the widget's configuration data.

  2. In the data processing node on the blueprint editor's configuration page, change the field values for the corresponding styles as needed.

Demo

For an example of how to use the ticker board, see Implement dynamic data summation.