Skip to main content

Stat Card

Applicable Scenarios#

提供报表场景下的指标数据统计并展示功能。

Usage Instructions

Data Model Use Cases

  1. Set the data source for the statistical card, select the existing data model, and select the data source method - statistics.
  2. Configure the data value range through data filtering. For details, see Data Filtering Configuration Document.
  3. Select the fields that need to be counted.
  4. Based on the selected fields, set the statistical method for that field. Currently, "numeric" fields support counting, summation, maximum, minimum, and average; other field types only support counting.
  5. Select whether to count null values. By default, null values are not counted.
  • Supports display unit settings. Numerical magnitudes: units/tens/hundreds/thousands/ten thousands/hundred thousands/millions/ten millions/hundred millions.
  • Decimal places: supports setting 0-10 decimal places.
  • Suffix: supports customization. By default, it is generated based on magnitude: -/tens/hundreds/thousands/ten thousands/hundred thousands/millions/ten millions/hundred millions.

Properties

External properties received by the component

Property Name
Property Identifier
Type
Description
Data sourcedataSourceobject

方法的出入参需满足组件要求,查看文档

data filterfilterDataobject
field selectionfieldobject
统计方式operationTypestring
字段展示名称labelstring

Example: "今日活跃用户数"

是否统计空值isCountEmptyboolean

Example: false

是否显示单位isShowUnitboolean

Example: true

Numeric value magnitudeunitnumber

Example: 1

number of decimal placesdecimalDigitsnumber

Example: 0

suffixsuffixstring

Events

Events exposed by the component. You can listen to component events to trigger external actions

Event Name
Event Code
Event Output Parameters event.detail
Applicable Scenarios
Description
clicktapCompatible with all platforms

-

API Use Cases

When APIs are selected as the data source during configuration, users must define data within the APIs according to the parameter structure for proper rendering in the statistical card component. For details, see Chart Component Parameter Definition.

? When using APIs, data filtering, field selection, statistical methods, and statistical properties for null values must all be defined by the user within the created APIs. Other properties remain consistent with the configuration of the data model usage scenario.

Frequently Asked Questions

The reason why charts do not support displaying Chinese names for association/enumeration fields

Since the chart component retrieves statistical data by querying the server, it currently does not support displaying Chinese names for association/enumeration/option set fields. If you need precise control over chart display, you can use the Universal Chart, which allows flexible display configurations through customization.

How to flexibly control various chart styles, such as centering the title?

Since the chart component itself only provides common configurations, for elements that cannot be configured within the chart component, you can use the Universal Chart to achieve various flexible display effects.

Relationship Between Chart Component and Universal Chart Component

  • The Universal Chart component is a versatile chart component capable of configuring various charts such as line charts, pie charts, area charts, maps, funnel charts, dashboards, and all other chart types. Using this component enables quick integration of all Echarts charts.
  • The UI configuration of the Universal Chart component is more flexible, supporting virtually all common chart types.
  • The Universal Chart component itself is data-agnostic. Data statistics can be achieved through Query, where data aggregation is performed via APIs or the MySQL connector, and then bound to the Universal Chart component.