Chart to PDF Issues

Hi,



Is there any update on the following issue:



CELLSJAVA-41047: Data separator of stacked column chart has different thickness.



Thanks,

Neeraj

Hi Neeraj,


I am afraid, the ticket CELLSJAVA-41047 is still open. We have requested the concerned member of the product team to share insight of the mentioned problem, and preferably an estimated time frame for the fix. As soon as we receive any updates in this regard, we will post here for your kind reference.

Thank you for your patience with us.

Hi,

Thanks for using Aspose.Cells.

Please try the new fix for column stacked chart border thickness issues i.e CELLSJAVA-41047.

Please download and try the latest fix: Aspose.Cells for Java (Latest Version) and let us know your feedback.

Hi,


This is to inform you that we have fixed your issue CELLSJAVA-41046 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Thank you.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java (Latest Version) and let us know your feedback.

It contains the fix for the following issue.

  • CELLSJAVA-41046 - Chart’s Legend Sequence has Changed while rendering Spreadsheet to PDF format

Hi,



Thanks for your reply.



I tried the latest fix you provided but unfortunately the issue is still not resolved. I have generated the chart’s PDF using Aspose.Cells v8.6.2.4 but the Legend Sequence is still wrong in the PDF generated.



I have attached the PDF taken using Aspose.Cells v8.6.2.4 as well as Excel generated PDF.



Can you please analyze this issue.



Thanks,

Neeraj

Hi,


Thanks for your reply.

I tried the latest fix you provided but unfortunately the issue is still not resolved. I have generated the chart’s PDF using Aspose.Cells v8.6.2.4 but the Legend Sequence is still wrong in the PDF generated.

I have attached the PDF taken using Aspose.Cells v8.6.2.4 as well as Excel generated PDF.

Can you please analyse this issue.

Thanks,
Neeraj

Hi Neeraj,


Please use Chart.toPdf method to convert charts directly to PDF format. Please check following piece of code and its resultant PDF as attached.

Java

Workbook workbook = new Workbook(dir + “ChartsRendering.xlsx”);
Chart chart = workbook.getWorksheets().get(“Charts”).getCharts().get(“Chart 8”);
chart.toPdf(dir + “response_chart8_8.6.2.4.pdf”);

Hii,


I am using chart.toPdf() method to generate the PDF. The issue exists for Chart 5, not Chart 8. If you will generate the PDF of Chart 5, you will see that the legend sequence is wrong.

Can you please look into this issue again?

Thanks,
Neeraj

Hi,


I have tested your scenario/ case using your template file a bit. Well, this is not an issue by any means. If you could open your template Excel file into MS Excel and select the “Chart 5” and now take the print preview of the chart manually, you will see similar output as per the generated chart in PDF format by Aspose.Cells APIs, see the screen shot for comparison here:
http://prntscr.com/9cfh4k

I have also attached the output PDF file for the “Chart 5” for your reference here.

Let us know if you still have any issue.

Thank you.

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


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

Hello,

We are using Aspose.Cells v17.8 and the following issue is still not resolved.

  • CELLSJAVA-41046 - Chart’s Legend Sequence has Changed while rendering Spreadsheet to PDF format

If you will open the excel file in MS Excel 2010, you will see that the legend sequence in Excel 2010 and in Aspose PDF output is not same. The legend sequence in Aspose PDF is in reverse order.

PFA the screenshot of the issue: aspose 17.8 comparison.png (11.5 KB)
aspose response_17.8.pdf (20.5 KB)

Can you please analyse this.

Thanks,
Neha

@Neha_Gautam,

Such issues are difficult to be sorted out. Could you try the workaround as suggested before. You can use the following code segment to fix before rendering:
e.g
Sample code:

System.out.print("Original legend Position : " +chart1.getLegend().getPosition());
chart1.getLegend().setPosition(LegendPositionType. LEFT);
System.out.print("New legend Position : " +chart1.getLegend().getPosition());

//If sets position of legend, x, y, width and height is not used.
//So must set them to original values again.
chart1.getLegend().setX(chart1.getLegend().getX());
chart1.getLegend().setY(chart1.getLegend().getY());
chart1.getLegend().setWidth(chart1.getLegend().getWidth());
chart1.getLegend().setHeight(chart1.getLegend().getHeight());

If you unzip the original excel file(ChartsRendering.xlsx), in /xl/charts/chart2.xml we can look the legend setting.
The legend position is “b”(bottom). Generally, if the position is “b” or “t”, the legend item is reserved.

 <c:legend>
                <c:legendPos val="b"/>
                <c:layout>
                    <c:manualLayout>
                        <c:xMode val="edge"/>
                        <c:yMode val="edge"/>
                        <c:x val="9.8019457278584007E-2"/>
                        <c:y val="0.86180994498975294"/>
                        <c:w val="0.89669421487603318"/>
                        <c:h val="0.13698630136986303"/>
                    </c:manualLayout>
                </c:layout>
                <c:overlay val="0"/>
                <c:spPr>
                    <a:noFill/>
                    <a:ln w="25400">
                        <a:noFill/>
                    </a:ln>
                    <a:effectLst/>
                </c:spPr>
            </c:legend>

Thank you.

Hello,

We can not use the workaround provided by you because we generate chart’s PDF dynamically where generic code is used for all charts. We cannot hard-code the legend positions as suggested. The legend positions in PDF output should always be same as they are in Excel and cannot be hard coded.

Currently we are using ‘chart.toPdf()’ API and its output should be the same as the chart appears in Excel.

Thanks,
Neha

@Neha_Gautam,

Well, I found the legend entries are not same for the chart as per MS Excel 2013 rather it is same is as per MS Excel 2007 display (you may confirm this by opening it in MS Excel 2007):
e.g
Sample code:

Workbook workbook = new Workbook("ChartsRendering.xlsx"); 
WorksheetCollection ws = workbook.getWorksheets(); 
Worksheet sheet1 = ws.get("Charts"); 
Chart chart = sheet1.getCharts().get("Chart 5"); 
chart.toPdf("out1.pdf") ;

Anyways, I have reopened the issue “CELLSJAVA-41046” again. We will check if we could make it same with MS Excel 2013/2016.

Once we have an update on it, we will let you know here.

Thank you.

@Neha_Gautam,

Please try our latest fix/version: Aspose.Cells for Java:

Your issue “CELLSJAVA-41046” should be fixed in it.

On our side, we open source file with different MS Excel versions. These are the same.
Please find attached different screenshots for your reference.
screenshots1.zip (153.6 KB)

The issues you have found earlier (filed as CELLSJAVA-41046) have been fixed in Aspose.Cells for Java (Latest Version).