trend

The trend component displays an increase or decrease over a period. The increment or decrement number can be formatted as a percentage, currency, or plain value.

Trend is available in the following content widgets:

Configuration options

Core structure

value

Positive or negative numeric value.

format

A selection of formats is available for the main value of the widget, for example, currency.

title

Display a title for the trend.

subtitle

Add a subtitle under the title text. Note: this text won't be displayed if isValueBottom is set to true

style

Properties used for component styling.

  • isValueBottom - By default, the value is on the right of the text. Set the property to true to move it underneath the text.

  • isValueHidden - hides the number and only shows an icon indicating an up or down trend.

  • isAlignRight - aligns everything to the right.

Examples and code snippets

Trend on value widget

Upward trend
Upward trend

This example shows an increase in company turnover. The company has a turnover of over 24K USD, and the trend component shows that the increase for the last week is 1250 USD.

Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHub.

widgets:
  trend-value:
    type: widget.value
    options:
      value: '23850'
      align: right
      format:
        numberStyle: currency
        currency: USD
      bottom: 
        type: component.trend
        options:
          title: 'Last week'
          value: +1250
          format:
            numberStyle: currency
            currency: USD
      top: 
        type: component.titles
        options:
          icon: chart
          iconColor: color6

Trend on chart widget

Percentage trend
Percentage trend

This example shows finance statistics. The trend component, indicates an increase in percent. Exactly 21% in the last period.

Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHub.

Trend on list widget

Patient trend over a period
Patient trend over a period

In this example, the widget-list shows a list of patients. There are a total of 569 patients and the trend component shows that 12 more patients were added in the last period.

Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHub. :

Last updated

Was this helpful?