render_chart
Create SVG or PNG charts from Vega-Lite JSON specifications. Supports bar, line, scatter, area, heatmap, boxplot, and layered charts.
Instructions
Render a Vega-Lite chart to SVG or PNG. Supports: bar, line, point (scatter), area, rect (heatmap), boxplot, and layered/composite charts. IMPORTANT: spec_json must be valid JSON with "$schema", "data", "mark", and "encoding" fields. Anti-patterns: missing $schema, omitting encoding types, >500 inline data rows. Call get_tool_guide('vegalite') for examples.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Scale factor for PNG (default: 1). Use 2 for retina-crisp output. | |
| format | No | Output format. SVG preferred. | svg |
| spec_json | Yes | Vega-Lite JSON spec (as string). Must include "$schema", "data", "mark", "encoding". Always specify encoding types (quantitative/nominal/temporal/ordinal). |