# Sparkline generator

Draw a tiny line or bar chart as SVG from a list of numbers, small enough to sit in a table cell or README.

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

## Inputs

- `values` (required, array): The numbers to plot, in order.
- `type` (optional, string, one of `line`, `bar`, default `"line"`): Chart style.
- `width` (optional, integer, default `160`, range 20..2000): Width in pixels.
- `height` (optional, integer, default `40`, range 10..1000): Height in pixels.
- `colour` (optional, string, default `"#2a78d6"`): Line or bar colour: hex or a basic colour name.
- `fill` (optional, boolean, default `false`): Shade the area under a line.
- `markers` (optional, boolean, default `false`): Mark the lowest and highest values.
- `stroke_width` (optional, number, default `2`, range 0.5..10): Line thickness in pixels.

## Example 1

```json
{"input":{"values":[1,3,2]}}
```

Result:

```json
{"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"160\" height=\"40\" viewBox=\"0 0 160 40\"><polyline points=\"2,38 80,2 158,20\" fill=\"none\" stroke=\"#2a78d6\" stroke-width=\"2\" stroke-linejoin=\"round\" stroke-linecap=\"round\"/></svg>","width":160,"height":40,"min":1,"max":3,"last":2}
```

## Example 2: Shaded, with markers

```json
{"input":{"values":[3,7,4,9,6,12,8],"fill":true,"markers":true}}
```

## Example 3: Bars with negative values

```json
{"input":{"values":[5,-2,4,8,-6,3],"type":"bar","colour":"#1baf7a"}}
```

**What is a sparkline?** A word-sized chart with no axes or labels. It shows the shape of a trend, not exact values.
