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": "ScatterWithSmoothLines",
"x": 100,
"y": 100,
"width": 400,
"height": 400,
"title": { "text": "Scattered Chart" },
"series": [
{
"name": "Series1",
"dataPointType": "Scatter",
"dataPoints": [
{ "xvalue": 1, "yvalue": 3 },
{ "xvalue": 2, "yvalue": 10 }
]
},
{
"name": "Series2",
"dataPointType": "Scatter",
"dataPoints": [
{ "xvalue": 5, "yvalue": 2 },
{ "xvalue": 3, "yvalue": 1 },
{ "xvalue": 2, "yvalue": 2 },
{ "xvalue": 5, "yvalue": 1 }
]
}
]
}
{
"type": "Chart",
"chartType": "ScatterWithSmoothLines",
"showDataLabelsOverMaximum": true,
"series": [
{
"dataPointType": "Scatter",
"dataPoints": [
{ "xValue": 1.0, "yValue": 3.0 },
{ "xValue": 2.0, "yValue": 10.0 }
],
"name": "Series1",
"smooth": true,
"order": 0,
"invertIfNegative": true
},
{
"dataPointType": "Scatter",
"dataPoints": [
{ "xValue": 5.0, "yValue": 2.0 },
{ "xValue": 3.0, "yValue": 1.0 },
{ "xValue": 2.0, "yValue": 2.0 },
{ "xValue": 5.0, "yValue": 1.0 }
],
"name": "Series2",
"smooth": true,
"order": 1,
"invertIfNegative": true
}
],
"hasTitle": true,
"title": { "text": "Scattered 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"
}
}