render_chart
Turns your data rows into interactive bar, line, area, pie, or scatter charts in the chat UI, making comparisons and trends clear.
Instructions
Render an interactive chart in the chat UI.
Use whenever the user asks to show / plot / visualize / graph / compare
data, or when a chart makes the answer clearer than text. Call this AFTER
fetching the rows with the data tools (e.g. get_castable_data) or computing
them with execute_sas_code, then pass the rows in as data. Keep data
small — aggregate or limit to just the rows you want to chart.
The chart is drawn by the user interface from this call; the tool itself does no plotting and returns the normalized chart spec.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | List of row objects, e.g. [{"month": "Jan", "sales": 120}, ...]. | |
| title | Yes | Chart title. | |
| x_key | Yes | Field for the x-axis / category (for pie, the slice label). | |
| y_keys | Yes | Field(s) plotted as series / values (for pie or scatter, one or two). | |
| stacked | No | For bar/area, stack the series instead of grouping them. | |
| subtitle | No | Optional subtitle. | |
| chart_type | Yes | One of bar, line, area, pie, scatter. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||