Create Authentication Headers
curl -v "https://api.aspose.cloud/connect/token" -X POST -d "grant_type=client_credentials&client_id=XXXX&client_secret=XXXX-XX" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"
curl -v "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/shapes" -d @"chart.json" -H "Content-Type: text/json" -H "Authorization: Bearer [Access Token]
chart.json file:
{
"type": "Chart",
"chartType": "Pie",
"x": 100,
"y": 100,
"width": 400,
"height": 400,
"title": { "text": "Pie Chart" },
"categories": [
{ "Value": "First" },
{ "Value": "Second" },
{ "Value": "Third" }
],
"series": [
{
"dataPointType": "OneValue",
"isColorVaried": true,
"dataPoints": [
{ "value": 20 },
{ "value": 50 },
{ "value": 30 }
]
}
]
}
{
"type": "Chart",
"chartType": "Pie",
"showDataLabelsOverMaximum": true,
"series": [
{
"dataPointType": "OneValue",
"dataPoints": [
{ "value": 20.0 },
{ "value": 50.0 },
{ "value": 30.0 }
],
"name": "Column02",
"isColorVaried": true,
"order": 0,
"invertIfNegative": true
}
],
"categories": [
{ "value": "First" },
{ "value": "Second" },
{ "value": "Third" }
],
"hasTitle": true,
"title": { "text": "Pie Chart" },
"name": "ChartObject",
"width": 400.0,
"height": 400.0,
"x": 100.0, "y":100.0,
"lineFormat": {
"alignment": "Center",
"capStyle": "Flat",
"dashStyle": "Solid",
"joinStyle": "Round",
"style": "Single",
"miterLimit": 10.0,
"width": 0.75
},
"selfUri": {
"href": "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/shapes/2",
"relation": "self"
}
}