Saving graph as jpeg

dear aspose.cells support,


I have a problem with saving some Excel graphs as a jpeg - complicated graphs are not saved properly.
I have attached a sample excel file - the code to save the graph is added below.
As you will see, the resulting jpeg does not look like it should be.

Thanks for looking into this.




Module Module1
Dim licensecells As Aspose.Cells.License = New Aspose.Cells.License
Dim asposecellslicensestring As String = My.Computer.Registry.GetValue(“HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MWorks”, “AsposeCellsLicense”, “”)
Dim configdirectorystring As String = My.Computer.Registry.GetValue(“HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MWorks\HPHMI”, “ConfigDirectory”, “”)
Sub Main()
Dim excel As New Aspose.Cells.Workbook(“E:\MWorks configuration\MWorks_HPHMI\templates\XYplot1.xlsx”)
REM license files
licensecells.SetLicense(asposecellslicensestring)
excel.CalculateFormula()
For Each a As Aspose.Cells.Worksheet In excel.Worksheets
For Each b As Aspose.Cells.Charts.Chart In a.Charts
b.ToImage(“E:\MWorks configuration\MWorks_HPHMI\templates\XYplot1.jpeg”, System.Drawing.Imaging.ImageFormat.Jpeg)
Next b
Next a
Console.ReadLine()
End Sub
End Module

Hi Guido,

Thanks for your posting and using Aspose.Cells.

We were able to replicate this issue by executing the following code with the latest version: Aspose.Cells
for .NET v8.3.1.1
. The chart image is not correct as it looks in Excel.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43255 - Chart image is not rendered correctly

I have also attached the output chart image for a reference.

C#

Workbook workbook = new Workbook(path);


Worksheet worksheet = workbook.Worksheets[0];


Chart ch = worksheet.Charts[0];


Bitmap bmpChart = ch.ToImage();

bmpChart.Save(path + “.out.jpg”, ImageFormat.Jpeg);


Hi,

Thanks for using Aspose.Cells.

We have fixed this issue.

Please download and try the latest fix: Aspose.Cells for .NET v8.3.1.2 and let us know your feedback.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.