Free Support Forum -

PlotArea positioning problem with Charts.ToImage()


I am using Charts.ToImage to take a chart on a worksheet, and saving it as a .png

As you can see from the two attached files, the y-axis takes up half of the image, thus squeezing the plot area into the right half of the image.

The code I'm using is straightforward:

Dim mysheet As Worksheet = m_appExcel.Worksheets(sSheet)

Dim bitmap As System.Drawing.Bitmap

bitmap = mysheet.Charts(CInt(sEntityNumber) - 1).ToImage()

Dim sFile As String = m_sResultsFolder & "\" & sTitle & ".png"

'Save the chart image file to disk.

bitmap.Save(sFile, System.Drawing.Imaging.ImageFormat.Png)

Can you suggest any way to get around this issue?



Hi Steve,

Please try the attached latest version/fix v4.8.2.9. If you still find the issue, kindly post your template Excel file (containing the chart or sample code to make your chart) here, we will check your issue soon.

Thank you.


Thanks for the quick response. Unfortunately, this didn't rectify the problem.

As requested, I have attached a xlsx file with the chart object, and the image generated by Aspose.




<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the template file.

Well, currently we don’t support to convert XLSX charts (Excel 2007 file format) to Image completely (only simple charts are supported). We have found the issue and registered in our internal issue tracking system with issue id: CELLSNET-14888. We will support them in feature after completing some important tasks on hand.

We will recommend you to convert your file to Excel 2003 XLS file format before converting to image as process of Chart2Image works fine in case the file is in XLS file format.

Thank You & Best Regards,

<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p>


Please try the attached latest version of Aspose.Cells. We have fixed your mentioned issue.

Also, we have started to develop converting Chart2Image for MS Excel 2007 and it’s scheduled to finish in August.

Thank You & Best Regards,

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

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