Hi,
I am using Aspose cells v8.6.3.2
On converting Chart 1 to PNG the aspect ratio is not preserved, initial chart size is 5X3 inches but in PNG, the size is 3007 X 1869 pixels (3/5 = 0.6 and 1869/3007 = 0.62).
For reference, sample code & documents attached.
Sample Code:
Workbook workbook = new Workbook(“Excel.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = “Aspect ratio”;
Chart chart = ws.get(worksheetName).getCharts().get(“Chart 1”);
chart.toImage(“D:\response_8.6.3.2.pdf”);
Can you please analyse this issue.
Thanks
Neha
Hi,
Thanks for your posting and using Aspose.Cells.
Please download and use the latest version: Aspose.Cells
for Java v8.6.3.4 it works fine and gives correct aspect ratio. Let us know your feedback.
Hi Neha,
Thanks for your nice sharp analysis and using Aspose.Cells.
I have looked into this issue further and found that it is not possible to do everything perfectly. I have tested it with Microsoft Excel. I saved your source excel file into HTML using Microsoft Excel 2010 and checked the chart images. These images were
752x452 = 0.6026
482x289 = 0.5995
I have attached the images for your reference. So this is not a bug and we are afraid, it cannot be improved further.