Bar chart as PDF
Custom title, subtitle and colours; returns a PDF.
Input
{
"type": "pie",
"data": [
{
"label": "January",
"value": 65,
"backgroundColor": "#FF638433",
"borderColor": "#FF6384"
},
{
"label": "February",
"value": 39,
"backgroundColor": "#FF9F4033",
"borderColor": "#FF9F40"
},
{
"label": "March",
"value": 49,
"backgroundColor": "#FFCD5633",
"borderColor": "#FFCD56"
},
{
"label": "April",
"value": 72,
"backgroundColor": "#4BC0C033",
"borderColor": "#4BC0C0"
},
{
"label": "May",
"value": 93,
"backgroundColor": "#36A2EB33",
"borderColor": "#36A2EB"
},
{
"label": "June",
"value": 84,
"backgroundColor": "#9966FF33",
"borderColor": "#9966FF"
}
],
"options": {
"title": "Barchart Generation for Automation Platforms with 1001fx",
"titleAlignment": "center",
"titleColor": "#2563EB",
"subtitle": "Automatic barchart generation from your data as image and PDF. Highly customizable.",
"subtitleAlignment": "center",
"subtitleColor": "#333333",
"gridColor": "#f2f2f2",
"fontFamily": "Roboto",
"titleFontSize": 20,
"subtitleFontSize": 16,
"axisTitleFontSize": 16,
"axisFontSize": 16,
"padding": 0,
"dataLabelAnchor": "center",
"dataLabelAlignment": "center",
"dataLabelFontSize": 16,
"indexAxis": "y"
},
"outputFormat": "pdf"
… (1 more lines)Output · HTTP 200
{
"statusCode": 200,
"headers": {
"content-type": "application/pdf",
"content-disposition": "attachment; filename=\"result.pdf\""
}
}Show curl command
curl -X POST 'https://api.1001fx.com/charts/barchart' \
-H 'X-API-KEY: YOURSECRETAPIKEY' \
-H 'Content-Type: application/json' \
-d '{"type":"pie","data":[{"label":"January","value":65,"backgroundColor":"#FF638433","borderColor":"#FF6384"},{"label":"February","value":39,"backgroundColor":"#FF9F4033","borderColor":"#FF9F40"},{"label":"March","value":49,"backgroundColor":"#FFCD5633","borderColor":"#FFCD56"},{"label":"April","value":72,"backgroundColor":"#4BC0C033","borderColor":"#4BC0C0"},{"label":"May","value":93,"backgroundColor":"#36A2EB33","borderColor":"#36A2EB"},{"label":"June","value":84,"backgroundColor":"#9966FF33","borderColor":"#9966FF"}],"options":{"title":"Barchart Generation for Automation Platforms with 1001fx","titleAlignment":"center","titleColor":"#2563EB","subtitle":"Automatic barchart generation from your data as image and PDF. Highly customizable.","subtitleAlignment":"center","subtitleColor":"#333333","gridColor":"#f2f2f2","fontFamily":"Roboto","titleFontSize":20,"subtitleFontSize":16,"axisTitleFontSize":16,"axisFontSize":16,"padding":0,"dataLabelAnchor":"center","dataLabelAlignment":"center","dataLabelFontSize":16,"indexAxis":"y"},"outputFormat":"pdf"}'