Skip to main content

line chart

Applicable Scenarios#

Display data trend changes over time for report scenario.

Usage Instructions

Go to the Application Editor page, then drag the Chart Component > Line Chart component into the corresponding container.

Properties

External properties received by the component

Property Name
Property Identifier
Type
Description
line typechartTypestring

Support line and curve

Example: "line"

Display HeadlinesisTitleboolean

Example: true

chart titletitlestring

Example: "折线图标题"

data filterfilterDataobject

Configurable data value ranges, see data filtering configuration

color schemesetColorarray

When multiple numerical or dimensional field groups exist, different categories are shown based on different color schemes, supporting customizable color palettes.

Example: [ "#2A70E2", "#46B690", "#EDB539", "#E46961", "#4FB3D2", "#805FDC" ]

Display null coordinatesxIsCountEmptyboolean

Example: false

Data sourcedataSourceTypestring

Data source type selection

Example: "data-model"

data modeldataModelobject

Show model data source

APIsconnectorobject

Data display APIs source selection

calling methodconnectorMethodobject

The input/output parameters of the method must meet the component requirements. View the document (https://cloud.tencent.com/document/product/1301/71197#.E6.9F.B1.E7.8A.B6.E5.9B.BE.E3.80.81.E6.8A.98.E7.BA.BF.E5.9B.BE.E3.80.81.E9.A5.BC.E5.9B.BE)

API invocation method selection for displaying data

Query input parametersconnectorParamsobject

对APIs调用方法获取的数据进行筛选过滤。支持对象类型,例如 {name:'',value:''}

field selectionxFieldobject

X-axis value field selection

Statistical dimensionxStatisticsstring
field selectionyFieldobject

Numeric value (Y-axis) field selection

groupgroupKeystring

When only one field is selected for the Y-axis, the X-axis can be grouped by a fixed field. Example: X-axis shows salesperson, grouped by sales region.

grouping dimensiongroupKeyTimeSpanstring
Display legendsisLegendboolean

Example: true

legend positionlegendstring

Example: "bottom"

Display axis nameisXaxisNameboolean

Example: true

NamexAxisNamestring

Example: ""

Display tagisXaxisAxisLabelShowboolean

Example: true

Display X-axis scaleisXaxisAxisTickShowboolean

Example: true

Text auto skewisXaxisAxisLabelRotateboolean

Example: false

Display grid linesisYAxisSplitlineLinestyleWidthboolean

Example: true

grid lines lineyAxisSplitlineLinestyleTypestring

Example: "solid"

Maximum valueyAxisMaxnumber
Minimum valueyAxisMinnumber
Display Y-axis nameisYAxisNameboolean

Example: true

NameyAxisNamestring

Example: ""

display numeric valueisYAxisShowboolean

Numeric value (Y-axis) field selection

Example: true

display numeric valueisSeriesShowSymbolboolean

Data Tag field selection

Example: true

display unitisUnitboolean

Example: false

Numeric value magnitudeunitnumber

Example: 1

number of decimal placesdecimalDigitsnumber

Example: 0

suffixsuffixstring

Example: ""

Events

None

Advanced Properties

Supports configuration of axis styles, data labels, display units, and other properties.

  • Display unit: supports numerical magnitudes such as 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.

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 all need to be defined by the user within the created APIs. Other properties remain consistent with the configuration of the data model usage scenario.

Usage Example

The following example data source is a sales performance table. The example data configuration is shown in the table below. For more data configuration operations, please refer to Data Model.

Salesperson NameCustomer RegionTotal SalesNumber of OrdersGenderOrder Date
Zhang SanBeijing10000003Male2022-01-01
Zhao SiBeijing20000002Male2022-02-02
Zhao SiShanghai1000001Male2022-03-03
Wang WuShanghai2000001Male2021-04-04
Wang WuShenzhen5000001Male2021-05-05
Li LiuBeijing50000006Female2021-06-06
Li LiuShenzhen2000001Female2021-07-07

Example: Monthly Total Sales Change Trend

  1. Create a new Line Chart component, go to the Properties > Basic Properties page on the right, click the Data Source dropdown menu, select the Sales Performance Table, and choose the Aggregation method.

  2. In Dimension (X-axis), click the Field Selection dropdown menu and select Order Date.

  3. Under Value (Y-axis), click Add Y-axis Field. Select Sales Total for Field type, and select Sum for Relationship type.

  4. In the properties panel on the right, navigate to Advanced Properties, then click to enable Display Unit. Click the Quantity Level dropdown menu and set it to Ten Thousand, and set the Suffix item to Ten Thousand.

  5. Modify properties such as the title, axis style, or legend style as needed.

? For more example configurations, refer to Bar Chart.

Limits Description

The dimension axis does not support setting the time type, but you can set the date type and datetime type.

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.