पायथन REST API का उपयोग करके एक एक्सेल चार्ट बनाएँ

This tutorial assists on how to create an Excel chart using Python REST API. You will learn how to add a graph in Excel using Python REST Interface with a Python-based Cloud SDK. It will expose all the necessary properties and methods required to perform this task online.

Prerequisite

Steps for Inserting Graph in Excel using Python Low Code API

  1. Create an instance of the CellsApi using a client ID, client secret, and API base URL
  2. Specify the Excel file name that will be uploaded
  3. Send a request to upload the specified local Excel file to the Aspose Cloud storage
  4. Prepare a request to add a pie chart to a specific worksheet using a defined cell area
  5. Use the API for adding a chart with the PutWorksheetChart() method to the uploaded Excel file stored in the cloud
  6. Request the modified Excel file containing the new chart from the cloud storage
  7. Save the downloaded file stream to a new file on the local system

These steps summarize how to put chart in Excel using Python Low Code API. Commence the process by uploading an Excel file to Aspose Cloud, adding a pie chart to a specified worksheet using a defined data range and position, and then downloading the updated file. The modified file is saved locally for further use.

Code to Add Pie Chart in Excel using Python REST Interface

This sample code has demonstrated the process of how to create a graph on Excel using Python REST API. You may create other types of charts by setting the desired value in the charType property. For adding multiple charts, create the desired requests and execute them in a loop for creating the graphs in the uploaded worksheet.

This article has taught us the process of creating a chart. For adding a formula in an Excel file, refer to the article on Adding Excel formula using Python REST API.

 हिन्दी