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.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/sparkline \
-H 'Content-Type: application/json' \
-d '{"input":{"values":[1,3,2]}}'
import json, urllib.request
body = {'input': {'values': [1, 3, 2]}}
request = urllib.request.Request("https://setget.net/v1/tools/sparkline", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/sparkline", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"values":[1,3,2]}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "sparkline",
"input": {
"values": [
1,
3,
2
]
}
}
{
"input": {
"values": [
1,
3,
2
]
}
}
Endpoint: POST /v1/tools/sparkline. Over MCP: run_tool with slug: "sparkline".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
values |
array | yes | The numbers to plot, in order. |
type |
string | no | Chart style. One of: line, bar. Default: "line". |
width |
integer | no | Width in pixels. Default: 160. From 20 to 2000. |
height |
integer | no | Height in pixels. Default: 40. From 10 to 1000. |
colour |
string | no | Line or bar colour: hex or a basic colour name. Default: "#2a78d6". |
fill |
boolean | no | Shade the area under a line. Default: false. |
markers |
boolean | no | Mark the lowest and highest values. Default: false. |
stroke_width |
number | no | Line thickness in pixels. Default: 2. From 0.5 to 10. |
Examples
Input
{
"values": [
1,
3,
2
]
}Result
{
"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
}Shaded, with markers
Input
{
"values": [
3,
7,
4,
9,
6,
12,
8
],
"fill": true,
"markers": true
}Result
Different every time. Press the example button above to see one.
Bars with negative values
Input
{
"values": [
5,
-2,
4,
8,
-6,
3
],
"type": "bar",
"colour": "#1baf7a"
}Result
Different every time. Press the example button above to see one.
Questions
- What is a sparkline?
- A word-sized chart with no axes or labels. It shows the shape of a trend, not exact values.
Related tools
- Chart generatorMake a clean SVG bar, line, area, pie or donut chart from labels and values, with axes, legend and title.
chart - Progress bar image generatorMake an SVG progress bar with a percentage label, your colours, rounded corners and optional stripes.
progress-bar-image - .gitignore generatorBuild a .gitignore for the languages, editors and operating systems you use, merged without duplicates.
gitignore-generate - ASCII banner text generatorTurn short text into large five-line banner letters for terminals, READMEs, logs and code comments.
ascii-banner - ASCII table generatorRender headers and rows as a box-drawing or plain ASCII table for terminals, logs and code comments.
ascii-table - Background pattern generatorMake seamless SVG background patterns (dots, grid, stripes, checker or waves) with your colours and scale.
pattern-image