Charts

From BuilderIO/agent-native · View interactive version

Charts is an AI agent skill from the GitHub repository BuilderIO/agent-native. Generate inline chart images (PNG) for embedding in chat responses. Use this skill when you need to create bar, line, or area charts for data visualization in chat.

How to use this skill

Skill file

Chart Generation

How It Works

Charts are generated server-side as PNG images using chartjs-node-canvas (Chart.js) and served via /api/media/. The generate-chart script renders charts and returns a fully qualified URL for embedding in chat markdown.

Script Usage

pnpm action generate-chart --type=bar --title="Title" --labels='["A","B","C"]' --data='[1,2,3]' --color="#18B4F4"

Parameters

| Param | Values | Default |

| ---------------------- | -------------------------------------------------------------------------- | ---------------------- |

| --type | bar, line, area | bar |

| --title | Chart title (keep SHORT) | required |

| --subtitle | Optional subtitle — avoid unless needed | — |

| --labels | JSON array of x-axis labels | required |

| --data | JSON array of numbers, OR array of {label, data, color} for multi-series | required |

| --color | Primary hex color | #18B4F4 |

| --theme | dark, light | auto from media/theme.json |

| --stacked | true for stacked bars | false |

| --filename | Output filename (no ext) | auto from title |

| --width / --height | Image dimensions | 800x400 |

Output

{ filename, url, width, height } — the url is fully qualified with cache buster.

Color Palette

| Color | Hex | Use |

| ------ | --------- | ---------------------------------- |

| Blue | #18B4F4 | Default/primary for all charts |

| Purple | #8b5cf6 | Secondary |

| Green | #22c55e | Tertiary |

| Amber | #f59e0b | |

| Indigo | #6366f1 | |

| Red | #ef4444 | |

| Teal | #14b8a6 | |

| Orange | #f97316 | |

Style Preferences (from Steve)

Good pattern:

**Example Corp Product Usage — Last 30 Days**
![chart](https://...your-app.example.com/api/media/chart.png?v=123)
**528 messages** over 18 active days | Peak: **89** (Feb 14)

QuickChart Inline Styling (for non-script charts)

When using QuickChart (https://quickchart.io/chart/create) with Chart.js v2:

Multi-Series & Stacked Charts

Key Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.