Generate chart image
generate_chart_imageGenerate one editorial chart from aligned labels and numeric datasets. Every datasets[].data array must contain exactly one number per label. Count both arrays before calling. Example: {"chartType":"bar","labels":["Email volume","Attributed revenue"],"datasets":[{"label":"Share (%)","data":[2,37]}]}. The tool renders the plot, applies brand-kit styling, uploads the PNG, and returns Markdown for embedding.
Use numeric datasets for charts, generate_diagram_image for exact-text layouts and generate_image for illustrative artwork. Creates a stored asset, not a CMS edit; repeated calls can create additional files.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"title": "Organic traffic",
"labels": [
"January",
"February"
],
"datasets": [
{
"data": [
220,
310
],
"label": "Search clicks"
}
],
"chartType": "bar"
},
"name": "generate_chart_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| theme | No | Visual theme preset. app_dark matches dashboard charts. | app_dark |
| title | No | Optional chart title rendered above the plot area. | |
| width | No | Optional image width in pixels (min 400, max 2400). Default: 1200. | |
| height | No | Optional image height in pixels (min 300, max 1800). Defaults to 630 for a horizontal article-friendly canvas. | |
| labels | Yes | Required X-axis labels or circular-chart segments. Count them before calling. Their count must exactly equal every datasets[].data count. | |
| context | No | User task for usage analytics. Omit private details. | |
| barStyle | No | Use grouped for independent series, stacked only for additive parts, or range with exactly two datasets ordered lower then upper. Never stack min/max endpoints. | grouped |
| datasets | Yes | Required dataset array. Each data array must contain exactly one finite number for each label, in the same order. Example with 2 labels: [{"label":"Share (%)","data":[2,37]}]. | |
| filename | No | Optional output filename. Defaults to chart-<timestamp>.png. | |
| subtitle | No | Optional explanatory subtitle or one-sentence takeaway rendered under the title. | |
| chartType | Yes | Use heatmap for a numeric matrix (datasets are named rows, labels are columns); waterfall for one signed-change dataset with totalIndices; line for trends; bar for comparisons. | |
| lineStyle | No | Line rendering style (for chartType=line). | area |
| llm_model | No | Exact model ID from the calling runtime. Send on every call when known. Omit if unavailable. | |
| projectId | No | Project ID from list_projects. Omit to use the configured or sole accessible project. | |
| textColor | No | Optional text color override in hex format. Applies to chart titles, subtitles, labels, legends, axes, and footer text. | |
| fontFamily | No | Optional font stack override. Applies to all chart text (e.g. 'Inter, Arial, sans-serif'). | |
| footerNote | No | Optional footer copy such as timeframe, sample size, methodology, or source note. | |
| logoSource | No | Choose the project brand-kit logo or explicitly request the Atomic logo. Missing or unreadable images are omitted without a replacement. | project |
| showLegend | No | Show dataset legend inside the chart area. | |
| valuePrefix | No | Bar/heatmap/waterfall value unit prefix, for example $. | |
| valueSuffix | No | Bar/heatmap/waterfall value unit suffix, for example M or %. | |
| totalIndices | No | Waterfall only: total bar indices, starting with 0. Other bars are signed changes. Later totals must equal the running balance. | |
| showAtomicLogo | No | Render the selected logo in the lower-right footer area only when its image loads successfully. | |
| backgroundColor | No | Optional background color override in hex format (e.g., #111315). | |
| respectDatasetColors | No | If true, dataset-provided colors override brand-kit colors. Default is false, so brand-kit colors are enforced. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Stored chart URL and the applied size, style and chart settings. Use markdown to embed it. | |
| success | Yes | True when the tool returns normally. | |
| executionTime | No | Elapsed time, e.g. 0.12s. |