Create Authentication Headers
Copy
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"
Copy
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:
Copy {
"type" : "Chart" ,
"chartType" : "ClusteredColumn" ,
"x" : 100 ,
"y" : 100 ,
"width" : 400 ,
"height" : 400 ,
"title" : { "text" : "Column Chart" },
"categories" : [
{ "Value" : "Category1" },
{ "Value" : "Category2" },
{ "Value" : "Category3" }
],
"series" : [
{
"dataPointType" : "OneValue" ,
"dataPoints" : [
{ "value" : 20 },
{ "value" : 50 },
{ "value" : 30 }
]
},
{
"dataPointType" : "OneValue" ,
"dataPoints" : [
{ "value" : 30 },
{ "value" : 10 },
{ "value" : 60 }
]
}
]
}
Copy {
"type" : "Chart" ,
"chartType" : "ClusteredColumn" ,
"showDataLabelsOverMaximum" : true ,
"series" : [
{
"dataPointType" : "OneValue" ,
"dataPoints" : [
{ "value" : 20.0 },
{ "value" : 50.0 },
{ "value" : 30.0 }
],
"name" : "Column02" ,
"order" : 0 ,
"invertIfNegative" : true
},
{
"dataPointType" : "OneValue" ,
"dataPoints" : [
{ "value" : 30.0 },
{ "value" : 10.0 },
{ "value" : 60.0 }
],
"name" : "Column03" ,
"order" : 1 ,
"invertIfNegative" : true
}
],
"categories" : [
{ "value" : "Category1" },
{ "value" : "Category2" },
{ "value" : "Category3" }
],
"hasTitle" : true ,
"title" : { "text" : "Column 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"
}
}