How can i convert a chart to image with aspose cloud cloud in python

How can I convert a chart to an image using Aspose Cloud in Python?

Hi everyone,

I’m trying to convert a chart (e.g., from an Excel or Word document) into an image using Aspose Cloud with Python, but I’m not sure how to do it.

I’ve looked through the documentation, but couldn’t find a clear example on how to extract or convert a chart to an image format like PNG or JPEG.

Could someone please guide me or share a sample Python code snippet that shows how to do this?

Thanks in advance!

@alexcrav,

Please refer to the code below:

import shutil
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.models import *
from asposecellscloud.requests import *

EmployeeSalesSummaryXlsx = “EmployeeSalesSummary.xlsx”
RemoteFolder = “PythonSDK”

Get Cells Cloud SDK instance

instance = CellsApi(os.getenv(‘CellsCloudClientId’),os.getenv(‘CellsCloudClientSecret’))

Upload a local Excel file to Cells Cloud Storage.

instance.upload_file( UploadFileRequest(EmployeeSalesSummaryXlsx, “PythonSDK/EmployeeSalesSummary.xlsx”))
request = GetWorksheetChartRequest( EmployeeSalesSummaryXlsx, ‘Sales’, 0,format= ‘png’,folder= ‘PythonSDK’,storage_name= ‘’)
tmp_path = instance.get_worksheet_chart(request)
shutil.move( tmp_path ,“EmployeeSalesSummary_Sales.png”)

Some basic examples are provided on GitHub. We will also improve the documentation as soon as possible. Thank you for your use and help.