chart_add
Add a chart to the model, saved with it and shown in the Charts dock. Name the nodes to draw and the kind; line, area, column, bar and waterfall draw one series per node over the periods; pie, doughnut, radar, treemap, sunburst and funnel take one number per node (reduce, default last); scatter, bubble and candlestick read their series by role in order; histogram, pareto and boxplot treat the window as a distribution; costcurve is a supply curve — each producer a bar as wide as its volume and as tall as its unit cost, cheapest first — read from pairs of series (volume, unit cost), one number each by atPeriod or reduce, with a role value series drawn across it as a price and an x series with no cost (total demand) drawn upright where demand cuts it. Give it a title and, when it is about one section, that section. A chart in the dock alone is on no page: card: true also puts it on the model's card, in the same change; for a document, add a chart block with document_set.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"kind": "<kind>",
"series": "<series>"
},
"name": "chart_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last period drawn: a label or an anchor | |
| axes | No | ||
| bins | No | Buckets for histogram and pareto | |
| card | No | Also show the chart on the model's card — after its last chart, else after its headline figures. Refused where the model has no card yet (model_card_set makes one). | |
| from | No | First period drawn: a period label, or an anchor actuals_end / forecast_start / fill_until | |
| grid | No | ||
| kind | Yes | ||
| model | Yes | Model uid (`model_…`), from model_list. | |
| title | No | ||
| legend | No | ||
| reduce | No | For a chart whose categories are the nodes: how the number is taken when atPeriod does not name one. Default last, never sum for a stock | |
| series | Yes | The nodes drawn, by name. A scatter reads its first two as x and y, a bubble adds size, a candlestick reads open, high, low, close in that order; a costcurve reads them in pairs, each producer's volume then its unit cost, unless you give roles; every other kind draws each as a value. | |
| section | No | The section this chart is about (a path); absent means the whole model | |
| stacked | No | Add the series together rather than drawing them side by side: one bar (or band) per period, split into the parts that make it up. `stacked` is the stacked column chart, `percent` the 100% stacked one where every bar fills the axis and each series shows its share. Only for a chart over the periods — column, bar, area or line — and not for one drawn on a calendar, which places its marks by date and has no bucket to add up. A stack is one value axis and one kind of mark: series on different axes are never added to each other, nor a line to a column, so drawing a series as a line or moving it to the secondary axis is how to keep it out of the stack. Within that, series naming the same `stack` go together, so one chart can hold revenue components beside cost components. | |
| atPeriod | No | For a chart whose categories are the nodes (pie, radar…): which period supplies the number | |
| timeAxis | No | ||
| periodicity | No |