# Chart generator

Make a clean SVG bar, line, area, pie or donut chart from labels and values, with axes, legend and title.

- Endpoint: `POST https://setget.net/v1/tools/chart` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `chart`
- Page: https://setget.net/tools/chart

## Inputs

- `type` (optional, string, one of `bar`, `hbar`, `line`, `area`, `pie`, `donut`, default `"bar"`): Chart type. hbar is a horizontal bar chart.
- `labels` (optional, array): One label per value: the categories or points along the axis. Numbered 1, 2, 3 when left out.
- `values` (optional, array): The numbers for a single series.
- `series` (optional, json): Several series for bar, hbar, line or area charts: a list of {"name": ..., "values": [...]}, up to 8.
- `title` (optional, string): Heading shown above the chart.
- `width` (optional, integer, default `720`, range 240..2000): Width in pixels.
- `height` (optional, integer, default `420`, range 160..2000): Height in pixels.
- `theme` (optional, string, one of `light`, `dark`, default `"light"`): Light or dark colours.
- `colours` (optional, array): Your own series colours in order, as hex or basic names. The built-in palette fills any gaps.
- `show_values` (optional, boolean, default `false`): Print each value at the end of its bar (single-series bar charts, when there is room).

## Example 1: A bar chart

```json
{"input":{"labels":["Mon","Tue","Wed","Thu","Fri"],"values":[12,19,7,15,22],"title":"Orders this week"}}
```

## Example 2: Two lines on a dark background

```json
{"input":{"type":"line","labels":["Q1","Q2","Q3","Q4"],"title":"Revenue by quarter","theme":"dark","series":[{"name":"2024","values":[31,42,38,51]},{"name":"2025","values":[36,47,52,64]}]}}
```

## Example 3: A donut chart

```json
{"input":{"type":"donut","labels":["Direct","Search","Social","Email"],"values":[420,310,150,90],"title":"Traffic sources"}}
```

**Why did my pie chart get an "Other" slice?** Past eight slices the colours stop being tellable apart, so the smallest slices are added together. Use a bar chart to show every item.

**What happens with many labels?** Axis labels are tilted, shortened or thinned out so they never overlap. Hover over a bar or point in a browser to see its exact value.

**Can I turn the SVG into a PNG?** Yes, with any SVG to PNG converter. SVG is best for web pages and documents because it stays sharp.
