---
title: ToolRouter — Tool Detail
description: Detailed documentation for a ToolRouter tool including skills, parameters, and examples.
url: https://toolrouter.com/tools/generate-chart
---
# Generate Chart

Convert raw numbers into professional chart images in seconds. Supports bar, line, pie, doughnut, radar, scatter, and more with automatic colors and custom dimensions. Returns a permanent shareable URL and downloadable image. Simple data input or full Chart.js config for precise control.

- **Version:** 0.02
- **Categories:** data, media

## Skills (1)

### Create Chart (`create_chart`)

Generate a chart image from data. Provide either a simplified input (type, labels, datasets) or a full Chart.js config for advanced control. Returns a permanent URL that renders the chart on-demand, plus a downloadable image when storage is available.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `type` | string | No | Chart type. Defaults to "bar". Ignored if "config" is provided. (bar, horizontalBar, line, pie, doughnut, radar, polarArea, scatter, bubble) [default: "bar"] |
| `title` | string | No | Chart title displayed at the top. Ignored if "config" is provided. |
| `labels` | array | No | X-axis labels (e.g. ["Jan", "Feb", "Mar"]). Ignored if "config" is provided. |
| `datasets` | array | No | One or more datasets to plot. Each needs at least a "data" array. Required unless "config" is provided. |
| `config` | object | No | Full Chart.js config for advanced control. Overrides type/title/labels/datasets when provided. |
| `width` | number | No | Chart width in pixels (default 600) [default: 600] |
| `height` | number | No | Chart height in pixels (default 400) [default: 400] |
| `format` | string | No | Output image format (default "png") (png, svg, webp) [default: "png"] |
| `background_color` | string | No | Chart background color (CSS color, default "white"). Use "transparent" for no background. [default: "white"] |

**Returns:** Short permanent URL to view the chart image, inline base64 image for supported clients, chart dimensions, and the Chart.js config used

**Examples:**

*Simple bar chart with revenue data:*

```json
{
  "type": "bar",
  "title": "Quarterly Revenue",
  "labels": [
    "Q1",
    "Q2",
    "Q3",
    "Q4"
  ],
  "datasets": [
    {
      "label": "Revenue ($k)",
      "data": [
        120,
        180,
        150,
        220
      ]
    }
  ]
}
```

*Multi-series line chart:*

```json
{
  "type": "line",
  "title": "Website Traffic",
  "labels": [
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri"
  ],
  "datasets": [
    {
      "label": "Visitors",
      "data": [
        1200,
        1900,
        1500,
        2100,
        1800
      ]
    },
    {
      "label": "Page Views",
      "data": [
        3400,
        4200,
        3800,
        5100,
        4600
      ]
    }
  ]
}
```

*Pie chart showing market share:*

```json
{
  "type": "pie",
  "title": "Market Share",
  "labels": [
    "Chrome",
    "Safari",
    "Firefox",
    "Edge",
    "Other"
  ],
  "datasets": [
    {
      "data": [
        65,
        19,
        4,
        4,
        8
      ]
    }
  ]
}
```

## Quick Start

```bash
# Via CLI
TOOLROUTER_API_KEY=tr_live_xxx npx -y toolrouter-mcp call generate-chart create_chart --type bar --title Quarterly Revenue --labels Q1,Q2,Q3,Q4 --datasets [object Object]

# Via REST API
curl -H "Authorization: Bearer tr_live_xxx" \
     -d '{"tool":"generate-chart","skill":"create_chart","input":{"type":"bar","title":"Quarterly Revenue","labels":["Q1","Q2","Q3","Q4"],"datasets":[{"label":"Revenue ($k)","data":[120,180,150,220]}]}}' \
     https://api.toolrouter.com/v1/tools/call
```

## Frequently Asked Questions

### What kinds of charts can I make?

You can create bar, line, pie, doughnut, radar, scatter, and other common chart types.

### Do I need a full Chart.js config?

No. Simple data input works for most cases, but you can pass a full config when you need exact control.

### Does the chart come with a shareable link?

Yes. The response includes a permanent chart URL you can embed or share directly.

### What size should I use for presentations?

The default is 600x400 px, and you can increase width and height when you want a larger export.

---

## Get Started with ToolRouter

**Already connected?** Call any tool with `use_tool({ tool, skill, input })`. Browse tools with `discover` or visit https://toolrouter.com/llms-full.txt

**New to ToolRouter?** Connect with one command (no API key needed — auto-provisions on first use):

```bash
# MCP (Claude Code, Codex CLI)
claude mcp add toolrouter -- npx -y toolrouter-mcp

# MCP (Cursor, Windsurf, Cline, VS Code, Gemini CLI, Claude Desktop)
{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

# Claude Chat / Claude Cowork / Claude Mobile — add as a connector:
# Settings → Connectors → Add custom connector → URL: https://api.toolrouter.com/mcp

# ChatGPT — add as an app:
# Settings → Apps → Advanced settings → enable Developer mode → Create app → MCP Server URL: https://api.toolrouter.com/mcp

# CLI (works instantly, no restart needed)
npx -y toolrouter-mcp tools                    # browse all tools
npx -y toolrouter-mcp search "seo"             # search by keyword
npx -y toolrouter-mcp call seo analyze_page --url https://example.com
```

Free tools work immediately. For paid tools, visit https://toolrouter.com/claim to add credits.

All platforms: https://toolrouter.com/connect | Full catalog: https://toolrouter.com/llms-full.txt | Docs: https://toolrouter.com/docs