Skip to main content
Custom chart types allow users to create custom chart displays by writing chart rendering code. Related data is still configured through data configuration, and after the system obtains the data, it is passed into the custom code function, where the chart is displayed based on the obtained data.

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 Logic

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:
  • queryResult type is
    representing data results;
  • chartAnnotation chart configuration information
  • entityType multidimensional dataset type
  • locale current locale
  • chartsInstance ECharts chart instance
  • utils utility function set
Custom logic needs to return results containing:
  • options: ECharts chart Option configuration object
  • onClick: Response function for chart click events, returns events and related slicers
Below is an example. The following logic can display data as a 3D scatter chart:
In the analysis chart property settings interface, you need to configure one Dimension and three Measure fields. Middle

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 the updateAxisPointer event:

Appendix

utils utility function set

示例

Related code is: