Skip to main content

ECharts components

This article describes components in Components Library > ECharts.

ECharts

The ECharts component renders interactive data visualisation charts. It supports preset chart types (bar, line, pie, scatter) with configuration through the Settings panel, and a custom JavaScript mode for full control over the ECharts option object. In the App Designer, select an ECharts on the canvas to configure it through three tab pages in the Settings panel: Props, Styles, and Advanced.

Props

The Props tab contains the chart data, appearance, and event properties of the ECharts component, organised into groups.

If a property displays the Variable Binding icon Variable Binding, that means it supports variable binding.

Chart data

PropertyUI ControlDefaultDescription
Custom OptionToggle switchOffWhen enabled, all preset configuration fields are hidden and a Custom JS Function Binding appears, allowing full programmatic control of the ECharts option object. When disabled, the preset Chart type, Extra props, and Chart data fields are used instead.
Custom JSFunction Bindingfunction e(t){var n={xAxis:{type:"category",data:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]},yAxis:{type:"value"},series:[{data:[150,230,224,218,135,147,260],type:"line"}]};t.setOption(n)}Sets a JavaScript function that receives the ECharts instance (myChart) and the ECharts library (echarts), and calls myChart.setOption(option) to configure the chart. Only available when Custom Option is enabled.
Chart typeDropdown (Bar | Line | Pie | Scatter)BarSelects the preset chart type. Only available when Custom Option is disabled.
Extra propsJSON setter-Sets additional ECharts option properties to merge with the preset configuration. Only available when Custom Option is disabled.
Chart dataData editor[23, 24, 18, 25, 27, 28, 25]Sets the data series values for the selected preset chart type. Only available when Custom Option is disabled.

Chart properties

The Chart properties group is only available when Custom Option is disabled. It provides individual JSON setters for standard ECharts option properties:

PropertyUI ControlDefaultDescription
AnimationToggle switchOffEnables or disables the chart's built-in animation.
Item StyleJSON setter-Configures the graphical style of the chart items (for example, color, border). Accepts an ECharts itemStyle object.
TitleJSON setter-Configures the chart title. Accepts an ECharts title object.
TooltipJSON setter-Configures the chart tooltip. Accepts an ECharts tooltip object.
LabelJSON setter-Configures the data labels on the chart. Accepts an ECharts label object.
LegendJSON setter-Configures the chart legend. Accepts an ECharts legend object.
XAxisJSON setter{"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]}Configures the x-axis. Accepts an ECharts xAxis object.
YAxisJSON setter-Configures the y-axis. Accepts an ECharts yAxis object.

Chart events

The Chart events section contains an Events array editor that allows you to configure interaction event handlers directly within the Props tab. Click "Add an item +" to add a new event. Each event item has:

PropertyUI ControlDefaultDescription
EventNameDropdown (Click | Dblclick | Mousemove)ClickSelects the ECharts interaction event to listen for.
QueryJSON setter-Sets an optional ECharts event query filter to limit the event to specific series or data items.
HandlerFunction Binding-Binds a function to handle the event. The function receives the ECharts params object containing event data such as seriesName, name, and value.

Advanced (Props sub-section)

Within the Props tab, an Advanced collapsible section provides:

PropertyUI ControlDefaultDescription
IDText inputAuto-generatedUnique HTML identifier for the element. Auto-generated from the component title (non-alphanumeric characters are replaced by underscores). You can override this value manually.
NameText inputAuto-generatedHTML name attribute for form identification. Auto-generated from the component title. You can override this value manually.

Styles

For more information, refer to Styles.

Advanced

For more information, refer to Advanced.

Custom JS usage

When Custom Option is enabled, the Custom JS function provides direct access to the ECharts instance. Use myChart.setOption(option) to define the full chart configuration:

customJs(myChart, echarts) {
const option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line'
}
]
};
myChart.setOption(option);
}

Best practices

  1. Use Preset Types for Simple Charts

    • Use the Chart type and Chart data fields for straightforward bar, line, pie, or scatter charts where the preset configuration covers your needs
    • Use Extra props to extend the preset with additional ECharts options such as axis labels or legend placement
  2. Use Custom Option for Complex Charts

    • Enable Custom Option when you need chart types not available in the presets (for example, radar, heatmap, candlestick) or require full control over multiple series and nested configuration
  3. Set Width and Height via Styles

    • Always set an explicit height and width (for example, 600px and 100%) in the Styles tab. ECharts requires a container with defined dimensions to render correctly
  4. Use Chart Events for Drill-Down Interactions

    • Add a click event handler in the Chart events section to implement drill-down navigation or data filtering when the user clicks a chart element

Last updated on 20 May 2026