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": "Sunburst",
"x": 100,
"y": 100,
"width": 400,
"height": 400,
"title": { "hasTitle": true, "text": "Sunburst Chart" },
"categories": [
{ "value": "Leaf1", "level": 3, "parentCategories": [ "Branch1", "Stem1" ] },
{ "value": "Leaf2", "level": 3, "parentCategories": [ "Branch1", "Stem1" ] },
{ "value": "Branch2", "level": 2, "parentCategories": [ "Stem1" ] },
{ "value": "Stem2", "level": 1 }
],
"series": [
{
"dataPointType": "OneValue",
"dataPoints": [
{ "value": 40 },
{ "value": 50 },
{ "value": 70 },
{ "value": 60 }
]
}
]
}
{
"type": "Chart",
"chartType": "Sunburst",
"showDataLabelsOverMaximum": true,
"series": [
{
"dataPointType": "OneValue",
"dataPoints": [
{ "value": 40.0 },
{ "value": 50.0 },
{ "value": 70.0 },
{ "value": 60.0 }
],
"order": 0,
"invertIfNegative": true
}
],
"categories": [
{
"parentCategories": [ "Branch1", "Stem1" ],
"level": 3,
"value": "Leaf1"
},
{
"parentCategories": [ "Branch1", "Stem1" ],
"level": 3,
"value": "Leaf2"
},
{
"parentCategories": [ "Stem1" ],
"level": 2,
"value": "Branch2"
},
{
"level": 1,
"value": "Stem2"
},
],
"title": { "text": "Sunburst Chart", "hasTitle": true },
"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"
}
}