Custom chart configuration
In Custom mode, configure charts by writing JS in the editor. Based on ctx.data, return a complete ECharts option. This suits merging multiple series, complex tooltips, and dynamic styles. In principle, all ECharts features and chart types are supported.

Data context
ctx.data.objects: array of objects (each row as an object)ctx.data.rows: 2D array (with header)ctx.data.columns: 2D array grouped by columns
Recommended usage:
Consolidate data in dataset.source. For detailed usage, please refer to the ECharts documentation:
Let’s start with a simple example.
Example 1: Monthly order bar chart

Example 2: Sales trend chart

Recommendations:
- Keep a pure function style: generate
optiononly fromctx.dataand avoid side effects. - Changes to query column names affect indexing; standardize names and confirm in "View data" before editing code.
- For large datasets, avoid complex synchronous computations in JS; aggregate during the query stage when necessary.
More examples
For more usage examples, you can refer to the NocoBase Demo app.
You can also browse the official ECharts Examples to find your desired chart effect, then reference and copy the JS configuration code.
Preview and Save

- Click "Preview" on the right side or at the bottom to refresh the chart and validate the JS configuration.
- Click "Save" to persist the current JS configuration to the database.
- Click "Cancel" to revert to the last saved state.

