Get Chart Area from a Worksheet - Aspose.Cells Cloud API
This REST API returns chart‑area information.
Prerequisites: To call this endpoint you must have a valid JWT access token, the target workbook must be uploaded to Aspose Cloud storage, and the file format must be supported by Aspose.Cells.
Background: A chart area defines the outermost bounding box of an Excel chart, including titles, legends, and the plot area. Retrieving its properties allows you to adjust layout and styling programmatically.
GetChartArea API
GET https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}/chartArea
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | Name of the workbook file. |
| sheetName | string | path | Name of the worksheet that contains the chart. |
| chartIndex | integer | path | Zero‑based index of the chart. |
| folder | string | query | Folder where the workbook is stored. |
| storageName | string | query | Name of the storage service. |
Response
{
"ChartArea": {
"Area": {
"BackgroundColor": { "A": "0", "R": "0", "G": "0", "B": "0" },
"FillFormat": { "Type": "Automatic" },
"ForegroundColor": { "A": "0", "R": "0", "G": "0", "B": "0" },
"Formatting": "Automatic",
"InvertIfNegative": false,
"Transparency": 0.0
},
"AutoScaleFont": false,
"BackgroundMode": "Automatic",
"Border": {
"BeginArrowLength": "Medium",
"BeginArrowWidth": "Medium",
"BeginType": "None",
"CapType": "Flat",
"Color": { "A": "0", "R": "0", "G": "0", "B": "0" },
"CompoundType": "Single",
"DashType": "Solid",
"EndArrowLength": "Medium",
"EndArrowWidth": "Medium",
"EndType": "None",
"IsAuto": false,
"IsAutomaticColor": false,
"IsVisible": false,
"JoinType": "Round",
"Style": "Solid",
"Transparency": 0.0,
"Weight": "HairLine",
"WeightPt": 0.0
},
"Font": {
"Color": { "A": "255", "R": "0", "G": "0", "B": "0" },
"DoubleSize": 10.0,
"IsBold": false,
"IsItalic": false,
"IsStrikeout": false,
"IsSubscript": false,
"IsSuperscript": false,
"Name": "Arial",
"Size": 10,
"Underline": "None"
},
"IsAutomaticSize": false,
"IsInnerMode": false,
"Shadow": false,
"Width": 0,
"Height": 0,
"X": 0,
"Y": 0,
"link": {
"Href": "https://api.aspose.cloud/v3.0/cells/Sample_Test_Book.xls/worksheets/Sheet5/charts/0/chartArea",
"Rel": "self"
}
},
"Code": "200",
"Status": "OK"
}
HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Filter applied successfully; response contains operation details. |
| 400 | Bad Request | Missing or invalid parameters (e.g., unsupported file type). |
| 401 | Unauthorized | Invalid or missing JWT token. |
| 413 | Payload Too Large | Uploaded file exceeds size limit. |
| 500 | Internal Server Error | Unexpected server error. |
How to Use the GetChartArea API with SDKs
GetChartArea API Specification
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 a call to the Cloud API with cURL.
Use Aspose.Cells Cloud SDKs
Using an SDK is the best way to speed up development. An SDK handles 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 call Aspose.Cells web services using various SDKs:
Generic HTTP request (e.g., using fetch):
fetch('https://api.aspose.cloud/v3.0/cells/Sample_Test_Book.xls/worksheets/Sheet5/charts/0/chartArea', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <jwt token>'
}
})
.then(response => response.json())
.then(data => console.log(data));