Base class for all Apache ECharts report types, providing query execution, option building, RPC handling, and the chart HTML/JS scaffold.
ECHARTSBASE — set as ReportType in def_report. Not intended to be used directly; subclasses set self.Type to select the ECharts series type.
def Render(self, Param1="", Param2="", Param3="") -> str:
Param1, Param2, and Param3 are included in the RPC payload and substituted into the SQL query as $param1$, $param2$, and $param3$. Returns a self-contained HTML string with an inline <style> block, a chart mount <div>, and a <script> block that initialises ECharts and starts the poll loop.
RpcGetoption(data)Primary RPC endpoint (called as method=getoption from the browser). Builds and returns the full ECharts option object as a dict, using the report's SQL query and _Options configuration. If the SQL returns a single-cell JSON object or a column named option, option_json, or echarts_option, that JSON is used directly as the option.
RpcGetseries(data)Backwards-compatible alias for RpcGetoption; older integrations calling method=getseries are supported transparently.
Options read from self._Options JSON:
| Key | Effect |
|---|---|
series_types / series / chart_types / type |
Comma-separated list or JSON array of ECharts series types (e.g. "bar,line"); controls the series rendered for each measure column |
echarts_option / option |
A complete ECharts option object to deep-merge over the auto-built option |
| Any other key | Passed through as top-level ECharts option overrides via deep merge |
Example:
{
"series_types": ["line", "bar"],
"echarts_option": {
"tooltip": {"trigger": "axis"},
"legend": {"top": "bottom"}
}
}
echarts@5.4.3).wordcloud, the echarts-wordcloud@2.1.0 extension is also loaded automatically._Height on the report definition.client_refresh (seconds) on def_report; a value of 0 disables polling.document.visibilityState !== "visible" and skips redundant updates when the option signature has not changed.line, bar, scatter, pictorialbar, boxplot, pie, doughnut, radar, heatmap, treemap, funnel, gauge, sankey, graph, chord (rendered as graph), wordcloud, venn, polar.Decimal and datetime values are serialised to float and ISO 8601 strings respectively before being sent to the browser.option/option_json/echarts_option, that JSON is used as-is as the ECharts option, bypassing all auto-build logic.| Type | Column shape |
|---|---|
line, bar, scatter, pictorialbar |
category, metric1 [, metric2 ...] |
pie, doughnut |
segment_name, value |
radar |
indicator_name, series1 [, series2 ...] |
heatmap |
x_category, y_category, intensity |
treemap, funnel |
node_name, value |
gauge |
label, value (or single numeric column) |
sankey, graph, chord |
source_node, target_node, weight |
wordcloud, venn |
term, weight |
polar |
category, value |
boxplot |
category, min, q1, median, q3, max |