Guides / Create

Chart → PNG

POST /v1/chart  · 

A Chart.js configuration → finished chart as PNG. All Chart.js types (bar, line, pie, radar, …), rendered server-side.

Parameters

NameTypeDescription
configobject · requiredChart.js configuration ({type, data, options}).
widthinteger · optionalDefault 900.
heightinteger · optionalDefault 500.
backgroundstring · optionalHex colour or "transparent", default white.

Example request

curl -X POST https://api.bigapi.dev/v1/chart -H 'Authorization: Bearer $KEY' -H 'Content-Type: application/json' -d '{"config":{"type":"bar","data":{"labels":["Q1","Q2"],"datasets":[{"data":[10,20]}]}}}' -o chart.png

Example response

HTTP/1.1 200 OK
Content-Type: image/png
X-BigAPI-Cost: 1

(PNG body, 900x500)

Related guides