Free Support Forum - aspose.com

Chart not showing in PDF

Hello,

I’m currently evaluating Aspose.Cells(4.8.0.0) and everything went well until I tried to save my document to pdf.
When I save the file to pdf, the chart is not visible.

I use the following code;

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells[“F1”].PutValue(50);
worksheet.Cells[“F2”].PutValue(100);
worksheet.Cells[“F3”].PutValue(150);
worksheet.Cells[“G1”].PutValue(4);
worksheet.Cells[“G2”].PutValue(20);
worksheet.Cells[“G3”].PutValue(50);
worksheet.Cells[“H1”].PutValue(“A”);
worksheet.Cells[“H2”].PutValue(“B”);
worksheet.Cells[“H3”].PutValue(“C”);

int chartIndex = worksheet.Charts.Add(ChartType.Pyramid, 0, 0, 10, 5);
Chart chart = worksheet.Charts[chartIndex];
chart.NSeries.Add(“F1:G3”, true);

workbook.Save(“c:\test1.pdf”,FileFormatType.Pdf);
workbook.Save(“c:\test1.xls”, FileFormatType.Excel2003);

The xls file is showing a simple chart, but it is missing in the pdf-file.

I also tried to use Aspose.pdf
MemoryStream str = new MemoryStream();
workbook.Save(str, FileFormatType.AsposePdf);
Pdf pdffile = new Pdf();
pdffile.BindXML(str, null);
pdffile.Save(“c:\pdf2.pdf”);
But this produces the same result.

Am I doing something wrong? Or can’t charts be saved in pdf-format.

Hi,

Thanks for sharing your code and detail.

Well, I am afraid, currently, Pyramid chart is not supported for excel-to-pdf conversion feature, see the Supported Charts List table in the document:
http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net/converting-chart-to-image.html

We suggest you to use other chart types accordingly at the moment, we will look into the feature(support for pyramid charts for excel-to-pdf conversion) in future versions.


Thank you.

Thank you for your quick reaction and the link.

Luckily all the other types of charts I currently need are supported

Hi,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. We have supported 3D Charts except 3D Bubble chart and Surface chart.

Thank You & Best Regards,