Hide Chart Legend in an Excel Worksheet – Aspose.Cells Cloud API

This REST API hides the legend in a chart. A chart legend is the box that identifies the data series plotted in the chart.

REST API

DELETE https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}/legend

Request parameters

Parameter Name Type Location Description
name string path Workbook name.
sheetName string path Worksheet name.
chartIndex integer path Index of the chart.
folder string query Workbook folder (optional).
storageName string query Storage name (optional).

The OpenAPI Specification defines this publicly accessible programming interface.

You can use the cURL command‑line tool to call the API easily. The example below demonstrates a request that hides the legend of chart 0 in Sample_Test_Book.xls.

Responses

HTTP Status Description Example JSON
200 OK Legend hidden successfully. { "Code": 200, "Status": "OK" }
401 Unauthorized Missing or invalid JWT token. { "Code": 401, "Message": "Invalid access token." }
404 Not Found Workbook, worksheet, or chart does not exist. { "Code": 404, "Message": "Chart not found." }
500 Internal Server Error Unexpected server error. { "Code": 500, "Message": "An unexpected error occurred." }

FAQ

Q: How do I hide a chart legend using Aspose.Cells Cloud?
A: Send a DELETE request to https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}/legend with a valid JWT token in the Authorization header. A 200 OK response indicates success.

Q: What authentication is required for the Hide Chart Legend API?
A: Include an Authorization: Bearer <jwt token> header. Obtain the token via the Aspose Cloud OAuth flow.

Q: What error response will I receive if the chart index is invalid?
A: The service returns 404 Not Found with a JSON body containing Code: 404 and a message describing the missing chart.

Q: Can I use HTTP instead of HTTPS?
A: No. All Aspose Cloud endpoints require HTTPS for security.

Cloud SDK Family

Using an SDK is the fastest way to develop. An SDK abstracts low‑level details so you can focus on your project tasks. Please check 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: