Pie chart as PDF
Custom title, subtitle and colours; returns a PDF.
Input
{
"type": "pie",
"data": [
{
"label": "January",
"value": 65,
"backgroundColor": "#FF6384"
},
{
"label": "February",
"value": 39,
"backgroundColor": "#FF9F40"
},
{
"label": "March",
"value": 49,
"backgroundColor": "#FFCD56"
},
{
"label": "April",
"value": 72,
"backgroundColor": "#4BC0C0"
},
{
"label": "May",
"value": 93,
"backgroundColor": "#36A2EB"
},
{
"label": "June",
"value": 84,
"backgroundColor": "#9966FF"
}
],
"options": {
"title": "PieChart / Donut Generation for Automation Platforms with 1001fx",
"titleAlignment": "center",
"titleColor": "#2563EB",
"subtitle": "Automatic piechart / donut generation from your data as image and PDF. Highly customizable.",
"subtitleAlignment": "center",
"subtitleColor": "#333333",
"fontFamily": "Roboto",
"titleFontSize": 32,
"subtitleFontSize": 16,
"dataLabelAnchor": "end",
"dataLabelAlignment": "end",
"dataLabelFontSize": 18,
"legendPosition": "top",
"legendFontSize": 18
},
"outputFormat": "pdf"
}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/piechart' \
-H 'X-API-KEY: YOURSECRETAPIKEY' \
-H 'Content-Type: application/json' \
-d '{"type":"pie","data":[{"label":"January","value":65,"backgroundColor":"#FF6384"},{"label":"February","value":39,"backgroundColor":"#FF9F40"},{"label":"March","value":49,"backgroundColor":"#FFCD56"},{"label":"April","value":72,"backgroundColor":"#4BC0C0"},{"label":"May","value":93,"backgroundColor":"#36A2EB"},{"label":"June","value":84,"backgroundColor":"#9966FF"}],"options":{"title":"PieChart / Donut Generation for Automation Platforms with 1001fx","titleAlignment":"center","titleColor":"#2563EB","subtitle":"Automatic piechart / donut generation from your data as image and PDF. Highly customizable.","subtitleAlignment":"center","subtitleColor":"#333333","fontFamily":"Roboto","titleFontSize":32,"subtitleFontSize":16,"dataLabelAnchor":"end","dataLabelAlignment":"end","dataLabelFontSize":18,"legendPosition":"top","legendFontSize":18},"outputFormat":"pdf"}'