ECharts
The ECharts widget can be used to generate graphs and charts. It is built using Apache ECharts, which is a high-level visualization library.
Refer to the ECharts documentation here for details on how to use the available chart types in WebStudio.
Model
The following properties can be defined for the ECharts widget. The table below provides more information about each of these properties.
{
"type": "echarts",
"actions": {},
"captionBar": {},
"data": [],
"dataSource": {},
"dragSource": {},
"dropTarget": {},
"echartsOptions": {},
"id": "echartsWidgetID",
"layout": {},
"name": "echartsWidget",
"options": {},
"registerMap": {},
"toolbars": {}
}
| Name | Description |
|---|---|
|
Widget type, in this case "echarts" |
|
Optional property to define action pipelines for specific trigger events. See the |
|
Configuration options for the widget caption bar. Set this property to false to hide the widget caption bars. Default is true. |
|
Defines data used to display ECharts graph or chart. |
|
Optional datasource to retrieve data or the widget model from the system. See the DataSource section below. |
|
Property used to allow dragging from the widget. For more information about configuring the widget as a drag-source, see here. |
|
Property used to handle drops from a drag-source. See here for information on configuring the widget as a drop-target. |
|
Additional specific options for the configuration of the ECharts widget. See the ECharts Options section below for more details. |
|
Unique widget identifier, can be customised but must be unique in the compilation. If this property is not defined, it will be automatically assigned a value when the widget is created. |
|
Options to configure the position and size of the widget. |
|
Optional name assigned to the widget, displayed in the widget caption bar if it is enabled. |
|
Configuration options including the |
|
Property used to register maps in the ECharts widget. See the Register Map section below. |
|
Optional property to add, edit and hide toolbars on the ECharts widget. See the |
Actions
The actions property is used to implement action pipelines for specific trigger events, defined using lifecycle and action hooks. Each of these hooks can contain a single action or a series of multiple actions.
The ECharts widget supports the generic widget lifecycle hooks.
In addition to these lifecycle hooks, the ECharts widget also supports the following action hooks.
onClick
The onClick action hook is invoked when the user clicks anywhere on the ECharts widget. Note that the action pipeline is executed on the release of the mouse button rather than on the "mouse-down" event. If the mouse pointer is moved outside of the widget before it is released, the action pipeline will not be executed.
{
"actions": {
"onClick": {
...
}
}
}
DataSource
The dataSource property can be used to initialise the model configuration of the ECharts widget. For information regarding the general treatment of data retrieved from a dataSource, see the widget documentation here.
ECharts Options
The echartsOptions are used to apply ECharts specific settings. More information can be found here.
{
"echartsOptions": {
"height": 100,
"locale": "",
"pointerSize": 10,
"renderer": "svg",
"theme": "default",
"useCoarsePointer": true,
"useDirtyRect": false,
"width": 100
}
}
| Name | Description |
|---|---|
|
Define the height of chart |
|
Defines the locale. Options are:
|
|
Specifies the size of the expanded mouse pointer area when in close proximity to interactive elements. Use this property in conjunction with the |
|
Defines how the chart is rendered. Options are:
|
|
Defines theme to be used for chart. Options are:
|
|
Set this property to true if the mouse pointer area should be expanded when in close proximity to interactive elements. This property should be used in conjunction with the |
|
Set this property to true to enable dirty rectangle rectangle. When enabled, only changes to the graphic will be re-rendered. Default is false. |
|
Define the width of the chart |
Toolbars
The toolbars property can be used to add, edit and hide toolbars for the ECharts widget. This widget supports multiple custom toolbars. For more details on configuring toolbars, see here.
Register Map
The registerMap property is used to register maps. See here for more details.
{
"registerMap": {
"geoJson": "",
"mapName": "Map Name",
"specialAreas": ,
"svg": ""
}
}
| Name | Description |
|---|---|
|
Optional property defining data using GeoJSON |
|
Assigns a custom name to the map |
|
When data is defined using |
|
Optional property defining data as an SVG. |
