Creating Custom Chart Logic
Create a chart component, select the chart type as Custom Chart, click the code edit button to open the custom chart logic code editor, and write custom ECharts chart calculation logic in the code editor.
Custom Chart Name
The custom chart name is the name of the chart component, used for display in story dashboards, and is also the unique identifier for the chart type.Custom Chart Function
The logic code of custom charts will be executed as a calculation function by the chart component. The function’s parameters and return result types are as follows:queryResulttype isrepresenting data results;chartAnnotationchart configuration informationentityTypemultidimensional dataset typelocalecurrent localechartsInstanceECharts chart instanceutilsutility function set
options: ECharts chart Option configuration objectonClick: Response function for chart click events, returns events and related slicers
Custom Chart Event Response
Custom chart logic receives the ECharts chart instance, so you can respond to various chart events through ECharts’ event mechanism. Below is an example of responding to theupdateAxisPointer event:
Appendix
utils utility function set| Function Name | Description |
|---|---|
echarts | ECharts utility set |
getEntityHierarchy | Get entity hierarchy structure |
getEntityProperty | Get entity properties |
getPropertyCaption | Get property display name |
getDefaultHierarchy | Get dimension’s default hierarchy structure |
stringifyProperty | Stringify field identifier |
示例
Related code is: