Create chart (SVG)
create_chartAggregate CSV data and render a bar or line chart as an SVG file in csv-insights-output/, returning the file path and plotted data.
Instructions
Aggregate a CSV and render a bar or line chart as an SVG file in csv-insights-output/. Returns the file path and the plotted data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Category / x-axis column | |
| y | No | Numeric column (omit to count rows) | |
| agg | No | sum | |
| top | No | Keep only the first N points after sorting (default 50) | |
| file | Yes | CSV path relative to the allowed directory (CSV_INSIGHTS_DIR), e.g. 'sales/2026-q3.csv' | |
| sort | No | Default: label for line, value_desc for bar | |
| type | Yes | ||
| title | No | ||
| where | No | Row filters, all must match (AND) | |
| output_name | Yes | File name for the chart (written as csv-insights-output/<name>.svg) |