Skip to main content

What it does

The render_chart tool lets the assistant create interactive charts inside the chat. When the assistant calls this tool, a Recharts-powered visualization is rendered inline — no external services or image generation needed.

Supported chart types

TypeBest for
barComparing categories or discrete values
lineTrends over time
areaVolume or cumulative data over time
pieProportional breakdowns (also supports donut style)

How it works

  1. You ask the assistant to visualize data (e.g., “chart this data”, “show me a bar chart”)
  2. The assistant calls render_chart with a chart specification
  3. The tool validates the data and returns a chart code block
  4. The UI renders it as an interactive Recharts visualization
Charts are rendered client-side in the web UI and desktop app. The gateway only validates the data and returns JSON — no images are generated server-side.

Chart specification

Cartesian charts (bar, line, area)

ParameterTypeRequiredDescription
type"bar" | "line" | "area"YesChart type
dataarray of objectsYesRow data (max 50 rows)
xKeystringYesKey for the X axis
seriesarray of { key, label? }YesSeries to plot (max 8)
titlestringNoChart title
descriptionstringNoShort description below the title
stackedbooleanNoStack series (bar and area only)
heightnumberNoChart height in pixels (100-400, default 240)

Pie charts

ParameterTypeRequiredDescription
type"pie"YesChart type
dataarray of objectsYesRow data (max 50 rows)
nameKeystringYesKey for slice names
valueKeystringYesKey for slice values
titlestringNoChart title
descriptionstringNoShort description below the title
donutbooleanNoRender as a donut chart
heightnumberNoChart height in pixels (100-400, default 240)

Handling missing data

Series values can be null to represent missing data points. The chart renderer treats null values as gaps — Recharts skips them gracefully in line and area charts, and omits them in bar charts.

Limits

ConstraintValue
Max rows50
Max series8
Height range100-400px
Data valuesMust be numeric (or null for missing)

Configuration

The render_chart tool is always registered — no external dependencies required. The chart palette follows the brand color tokens defined in @spaceduck/brand.