Add a Chart to a Worksheet – Aspose.Cells Cloud API Guide

This REST API adds a new chart to a worksheet.

REST API

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

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 Workbook name.
sheetName string path Worksheet name.
chartType string query Chart type (see the Type property in the chart resource). Supported chart types include Bar, Column, Line, Pie, Scatter, Area, Doughnut, Radar, etc.
upperLeftRow integer query Upper-left row index of the chart area (0‑based).
upperLeftColumn integer query Upper-left column index of the chart area (0‑based).
lowerRightRow integer query Lower-right row index of the chart area (0‑based).
lowerRightColumn integer query Lower-right column index of the chart area (0‑based).
area string query Range that provides the values to plot (e.g., A1:B5).
isVertical boolean query Indicates whether the chart orientation is vertical.
categoryData string query Range of category‑axis values (e.g., D1:E10).
isAutoGetSerialName boolean query If true, series names are automatically generated.
title string query Title of the chart.
folder string query Folder that contains the workbook.
storageName string query Name of the storage.
dataLabels boolean query Show data labels when true.
dataLabelsPosition string query Position of data labels (e.g., Above).
pivotTableSheet string query Name of the sheet that contains the pivot table.
pivotTableName string query Name of the pivot table.

Response

{
    "Status":"OK",
    "Code":200
}

Response Status Codes

Code Meaning Description
200 OK Compression succeeded; response contains compressed file 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 PutWorksheetAddChart API with SDKs

PutWorksheetAddChart 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 abstracts 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: