We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issues with Chart to Image

I have an Excel file with a “Stock” chart with an embedded shape/picture inside the chart (see attached xls). I am trying to convert that chart to an image and embed the image in a Word document. In Excel, it would be something like selecting the chart, copying it, and pasting it as image. I am seeing two issues: 1) the embedded shape/picture is not being sent to the image and 2) the formatting of the chart is not the same as it is in Excel (the y values surpass the maximum value axis value). The same thing happens if I use the SheetToImage method of the worksheet. Thanks.

Here’s the code:
Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense(“Aspose.Total.lic”);

Aspose.Words.License license2 = new Aspose.Words.License();
license2.SetLicense(“Aspose.Total.lic”);

Workbook wb = new Workbook();
wb.Open(@“c:\temp\stock_test.xls”);
Worksheet ws = wb.Worksheets[0];

Chart chart = ws.Charts[0];
System.Drawing.Bitmap bitmap = chart.ToImage();
bitmap.Save(@“c:\temp\imagetest.png”, ImageFormat.Png);
Graphics gr = Graphics.FromImage(bitmap);
Rectangle rc = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertImage(bitmap);
doc.Save(@“c:\temp\imagetest.doc”);

Hi,

Thanks for providing us the template file.

After an initial test, we found the issues you have mentioned.

I have logged the bug into our issue tracking system with an issue id: CELLSNET-13641. We will keep you updated when it is resolved.

Thank you.

Thanks. Is there an estimated timeline of when this might be fixed? I need to implement this feature in a release by next month and if this is not possible I need to come up with either a workaround or use an Excel macro (vba) to do this (highly undesirable). :slight_smile:

Hi,

We will try to provide a fix by the end of this week to resolve your issue(s).


Thank you.

Hi,

Please try the attached version.

<span style=“font-family: “Arial”,“sans-serif”;”>We have fixed
High-Low line and picture not rendering issues.


Thank you.
<span style=“font-family: “Arial”,“sans-serif”;”><o:p></o:p>

The issues you have found earlier (filed as 13641) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.