Update Chart Properties
This REST API updates chart properties.
REST API
POST http://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}
The request parameters are:
| Parameter Name | Type | Path/Query String/HTTPBody | Description |
|---|---|---|---|
| name | string | path | The name of the Excel file. |
| sheetName | string | path | The name of the worksheet containing the chart. |
| chartIndex | integer | path | Zero-based index of the chart to be updated. |
| chart | object | body | JSON object that defines the chart properties to be modified. |
| folder | string | query | The folder in storage where the file is located. |
| storageName | string | query | The name of the storage service. |
Request Body Schema
The chart object contains the properties you can modify. Below is a representative JSON example that includes several commonly used fields:
{
"Title": {
"Text": "Quarterly Sales"
},
"ShowLegend": true,
"Type": "Line",
"DataLabels": {
"ShowValue": true,
"ShowPercentage": false
},
"ChartArea": {
"BorderColor": "Blue",
"FillColor": "White"
}
}
Note: Only the fields you need to change have to be supplied. Omitted properties retain their existing values.
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The following example shows how to make calls to the Cloud API with cURL.
Response
The API returns a JSON object indicating the operation result. A successful update yields:
{
"Code": 200,
"Status": "OK"
}
Possible error responses include:
| HTTP Status | Description |
|---|---|
| 400 | Bad Request – invalid parameters or body |
| 401 | Unauthorized – missing or invalid token |
| 404 | Not Found – file, worksheet, or chart not found |
| 500 | Internal Server Error |
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK takes care of low‑level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs: