Interactive ECharts
echartsRender an interactive Apache ECharts chart from a standard ECharts option JSON object. Supports line, bar (incl. stacked & dual-axis mixed), pie, radar, scatter, funnel, gauge, sankey, graph and more — chosen via series[].type. Use this whenever a user would benefit from a chart or data visualization instead of raw numbers. The option field description contains ready-to-copy JSON templates for every common chart type — follow those shapes and fill in the user's real data. Inputs: option (required ECharts option object), optional title, subtitle, insights (one-line takeaway under the chart). When enableInteractivity is true (default), clicking a data point sends a follow-up message to the conversation for drill-down. Output valid JSON only (no comments, no functions).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Card title shown above the chart. | |
| locale | No | UI language for the rendered card. | en |
| option | Yes | A valid Apache ECharts option object. Generate it from the user's data. Type templates (copy the shape, fill in real data): Valid JSON only: no comments, no trailing commas, no functions. Always include "series": [{ "type": ..., "data": [...] }]. line: {"tooltip":{"trigger":"axis"},"xAxis":{"type":"category","data":["Mon","Tue","Wed"]},"yAxis":{"type":"value"},"series":[{"type":"line","smooth":true,"data":[120,200,150]}]} bar: same axis shape as line, then {"series":[{"type":"bar","data":[5,9,7]}]} stacked bar: series:[{type:"bar",stack:"t",data:[..]},{type:"bar",stack:"t",data:[..]}] mixed (bar+line, dual axis): {"xAxis":{"type":"category","data":[..]},"yAxis":[{"type":"value"},{"type":"value"}],"series":[{"type":"bar","yAxisIndex":0,"data":[..]},{"type":"line","yAxisIndex":1,"data":[..]}]} pie: {"tooltip":{"trigger":"item"},"series":[{"type":"pie","radius":["40%","70%"],"data":[{"name":"A","value":10},{"name":"B","value":20}]}]} radar: {"tooltip":{},"radar":{"indicator":[{"name":"Speed","max":100},{"name":"Cost","max":100},{"name":"Quality","max":100}]},"series":[{"type":"radar","data":[{"name":"Model A","value":[80,40,70]},{"name":"Model B","value":[60,70,85]}]}]} scatter:{"xAxis":{"type":"value"},"yAxis":{"type":"value"},"series":[{"type":"scatter","symbolSize":8,"data":[[10,20],[15,25],[30,12]]}]} sankey: {"tooltip":{"trigger":"item"},"series":[{"type":"sankey","data":[{"name":"A"},{"name":"B"},{"name":"C"}],"links":[{"source":"A","target":"B","value":5},{"source":"B","target":"C","value":3}]}]} funnel: {"tooltip":{"trigger":"item"},"series":[{"type":"funnel","data":[{"name":"Visit","value":100},{"name":"Signup","value":45},{"name":"Buy","value":12}]}]} gauge: {"series":[{"type":"gauge","min":0,"max":100,"data":[{"value":72,"name":"Score"}]}]} Notes: category x-axis needs "data": [...]; pie/radar/sankey/funnel/gauge need no xAxis/yAxis. Keep series[].data as a plain array; use objects only for pie/funnel/radar named items. Dark theme, axis colors, legend and tooltip styling are auto-applied — omit styling unless needed. | |
| insights | No | A one-line AI takeaway rendered under the chart. | |
| subtitle | No | Small subtitle under the title. | |
| enableInteractivity | No | When true, clicking a data point sends it back to the conversation. |