POST
/v1/generators/chart2 credits / callChart SVG generator
Generate a clean bar or line chart SVG from comma-separated labels and numeric values.
| Parameter | Type | Required | Description |
|---|---|---|---|
| labels | string | Yes | Comma-separated labels (1-20). |
| values | string | Yes | Comma-separated non-negative numeric values. |
| type | string | No | bar | line. Default: bar. |
| color | string | No | Six-digit hexadecimal series color. Default: #2563eb. |
Request
curl -X POST https://toolsonduty.com/api/v1/generators/chart \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"labels":"Jan,Feb,Mar","values":"12,18,9","type":"bar"}'Response
{
"ok": true,
"data": {
"type": "bar",
"width": 720,
"height": 400,
"svg": "<svg>...</svg>"
}
}