Render ECharts
render_echartRenders ECharts options server-side to produce SVG, PNG, or self-contained HTML, enabling chart generation without a browser.
Instructions
Renders an Apache ECharts visualization server-side (no browser). Returns image (base64 PNG), SVG text, and/or self-contained interactive HTML, selectable via the formats list. PNG requires the optional @napi-rs/canvas dep. For chat-platform targets (Slack/Discord/Telegram), use exportToUrl (needs hosting config).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| theme | No | Built-in theme name (e.g. 'light', 'dark') or an inline theme JSON object. | light |
| width | No | Render width in pixels (logical/CSS px). | |
| height | No | Render height in pixels (logical/CSS px). | |
| option | Yes | Standard Apache ECharts option object (full passthrough to echarts v6). | |
| formats | No | Output formats to produce in one call: 'svg' (text block with raw SVG), 'png' (image block with base64 PNG; requires optional @napi-rs/canvas), 'html' (text block with a self-contained interactive static HTML page). | |
| animation | No | Whether to emit animated output. Disabled by default for deterministic output. | |
| background | No | Background color for the chart (e.g. '#ffffff' or 'transparent'). | transparent |
| exportToUrl | No | When true and chart hosting is configured, also persist the chart and return its public HTTPS URL (for Slack/Discord/Telegram targets). | |
| devicePixelRatio | No | DPI multiplier for raster/PNG output. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | ||
| url | No | ||
| html | No | ||
| theme | Yes | Theme name used ('inline' when a theme object was supplied). | |
| width | Yes | ||
| height | Yes | ||
| formats | Yes | ||
| version | Yes | Pinned echarts runtime version. | |
| warning | No | ||
| pngBytes | No | ||
| background | Yes | ||
| pngMimeType | No |