Hi,
Hi,
Thanks for the response.
Hi,
Hi,
Thanks for your posting and considering Aspose.Cells.
Please check the attached sample excel file, I used to test this issue. I have also attached the chart image generated by it for your reference.
Here are the list of methods, GET, POST, PUT, DELETE
For this URL, you will use GET method.
URL:
http://api.aspose.cloud/v1.1/cells/sample.xlsx/worksheets/Sheet1/charts/0?format=jpeg
Check the red parts in the URL. First is workbook name, second is sheet name and 0 means 1st chart.
Please note, in Aspose.Cells, index starts from 0 not from 1. So if you want to get the image of 5th chart, index will be 4 and if you want to get the image of 3rd chart, index will be 2.
Before, you use the GET method with the URL, you must sign the URL with your AppSID and AppKey.
So after signing, the above URL looks like this
Signed URL:
http://api.aspose.cloud/v1.1/cells/sample.xlsx/worksheets/Sheet1/charts/0?format=jpeg&appSID=1d9fc1XXXXXXXXXXXXXXX78620415f&signature=f%2BoTXXXXXXXXXXXXXXX%2BHJw
Now you will use this Signed URL with GET method and it will return you image in JPEG format of the first chart in the Sheet1 of your sample excel file.
**C#**
//Please upload sample.xlsx file in the cloud storage.
string strURI = “http://api.aspose.cloud/v1.1/cells/sample.xlsx/worksheets/Sheet1/charts/0?format=jpeg”;
strURI = Sign(strURI, m_AppSID, m_AppKey);
//Call Process Command with Signed URI
using(Stream responseStream = ProcessCommand(strURI, “Get”))
{
//Save responseStream on disk with .jpg extension
}
Please note, since Aspose.Cells Cloud 19.9 we have introduced a new API Version V3. It uses JSON Web Token(JWT) for API request authentication. Now updated sample cURL and C# code is as follows. Please feel free to contact us for any further assistance.
cURL code:
curl -X GET "https://api.aspose.cloud/v3.0/cells/Book1.xlsx/worksheets/Sheet4/charts/0?format=png&folder=Temp"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
-H "x-aspose-client: Containerize.Swagger"
C# code:
string name = MYDOC;
string sheetName = SHEET3;
int? chartNumber = 0;
string folder = TEMPFOLDER;
string format = "png";
var response = cellsAPI.CellsChartsGetWorksheetChart(name, sheetName, chartNumber, format, folder);