Chart to PDF Issues

Hi,


I have following 3 issues while rendering charts to PDF using PDFSaveOptions.
1. Charts are marginally being cut in the generated PDF. Refer attached file: Chart3-Pie.pdf
2. Chart text being overlapped at the bottom. Space between the bottom text and y-axis line being reduced. Refer attached file: Chart2-Bar.pdf
3. Extra horizontal and vertical lines around the bars of the chart are appearing in the generated PDF. Refer attached files: Chart2-Bar.pdf and LinesSurroundBars.JPG (showing extra lines highlighted in yellow)

On the other hand, when I generate the PDF output of the same charts using MS Excel, none of the above mentioned issues appear.

Following code snippet is being used to generate the PDF of the charts:
Workbook workbook = new Workbook(“C:/temp/ChartTextOverlapping.xls”);
WorksheetCollection ws = workbook.getWorksheets();
Worksheet sheet1 = ws.get(“Charts”);
Chart chart = sheet1.getCharts().get(“Chart 2”);
ChartShape cshape = chart.getChartObject();

System.out.println(chart.getHeightPercent());
System.out.println(chart.getChartArea().getWidth());
int sheetIndex = ws.add();
Worksheet worksheet = ws.get(sheetIndex);

//Setting the name of the newly added worksheet
String transientSheetName = “TransientWorksheet”;
worksheet.setName(transientSheetName);
//Copy the Chart to Second Worksheet
worksheet.getShapes().addCopy(cshape, 0, 0, 0, 0);

//Get the new chart and set its height and width accordingly
Chart chart1 = worksheet.getCharts().get(0);
chart1.getChartObject().setHeight(cshape.getHeight());
chart1.getChartObject().setWidth(cshape.getWidth());


//Making remaining sheets invisible as the output is required for only TransientWorksheet
for (int i = 0; i < ws.getCount(); i++) {
String sheetName = ws.get(i).getName();
if(!transientSheetName.equalsIgnoreCase(sheetName)){
ws.get(i).setVisible(false);
}
}
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setOnePagePerSheet(true);

worksheet.getPageSetup().setTopMargin(0);
worksheet.getPageSetup().setBottomMargin(0);
worksheet.getPageSetup().setRightMargin(0);
worksheet.getPageSetup().setLeftMargin(0);

workbook.save(“c:/temp/Chart2-Bar.pdf”, pdfSaveOptions);


Thanks,
Neeraj

Hi Neeraj,


Thank you for providing your sample spreadsheet & resultant PDF files for our review.

We have evaluated the presented scenarios while using the latest version of Aspose.Cells for Java 8.2.0.4 against your provided spreadsheet, and we are able to replicate all of the mentioned issues. The problems have been logged in our bug tracking system for further investigation & correction purposes.

The ticket details are as follow.

  1. CELLSJAVA-40987: Chart’s Axis Labels & Legend are Overlapping
  2. CELLSJAVA-40988: Chart’s Data Label is Trimmed Off
  3. CELLSJAVA-40989: Bar Chart has Extra Vertical Lines on Right of the Bars

Please spare us little time to properly investigate the problem cause, and to provide the fix for these problems. In the meanwhile, we will keep you posted with updates in this regard.

Hi,


Is there any update on the above mentioned tickets?

These issues have become critical to our customers who are on their production cycle.

It would be appreciable if a patch build addressing these issues can be provided ASAP.

Thanks,
Neeraj

Hi Neeraj,


Thank you for your patience with us.

We have checked the statuses of the tickets attached to this thread. Unfortunately, these tickets have not been marked resolved yet so we have recorded a note for the concerned development team member stating the urgency of the matter. Please allows us some time to discuss these problems internally in order to provide an estimated release schedule for the fix. We will keep you posted with updates in this regard.
Hi,

Is there any update on the above mentioned issues? I just wanted to apprise you with the criticality of these issues. Our customers, who have gone live, are asking for immediate fix of these issues and repeatedly asking the status and timelines with regard to these issues. To keep our customers updated, can you please let me know - what is the current state of these issues and till what time we should expect fix for these defects.


Thanks,
Neeraj

Hi Neeraj,


Thank you for your patience with us.

Unfortunately, we haven’t yet received any updates regarding the tickets attached to this thread. Now we have raised the priority of all the tickets, and requested the concerned development team member to share the insight of these problems and most preferably an estimated release schedule. Please spare us little time so we may get back to you with updates in this regard.

We are sorry for the inconvenience caused to you.
Thanks.

Additionally, note the following issues which we recently found with charts to PDF rendering:

1. Legends of charts are not appearing in same sequence as they are in source Excel file. It appears fine while the PDF of the same chart is generated from MS Excel
2. In the columns of the chart, white space showing separation of data within the column,is thicker as comapred to the actual one (or when compared to the MS Excel PDF).

Kindly make note of these issues as well.

I would appreciate if you share us the estimated release schedule ASAP.

To reproduce these issues, I have attached the source XSL file and both PDFs generated using Apose and MS Excel. Whereas, source code as stated initially in the thread can be used for generation of PDFs.

Thanks,
Neeraj


Hi Neeraj,


Thank you for writing back.

We have evaluated your recently presented scenario while using the latest version of Aspose.Cells for Java 8.2.1.3, and are able to reproduce both mentioned problems. Moreover, we have found another issue related to the columns of the chart overlapping the bottom axis so we have logged 3 tickets in our bug tracking system. Please find the ticket details as follow.

  • CELLSJAVA-41045: Columns of the chart are overlapping with bottom axis
  • CELLSJAVA-41046: Chart’s legend sequence has changed
  • CELLSJAVA-41047: Data separator of stacked column chart has different thickness

We will further analyze these problem on our end to provide a fix at earliest possible. In the meanwhile, we will keep you posted with updates in this regard.

Please accept our apologies for your inconvenience.

Hi Neeraj,

Thanks for using Aspose.Cells.

It is to update you that we will provide a fix for your issues before 24-Oct-2014.

Hi,


Thanks for updating with the release date.

I assume the forthcoming release would also address fix for issues reported in the following thread:
Charts to PDF rendering problems
I would appreciate if you update this thread as well for our tracking purposes.

Thanks,
Neeraj

Hi Neeraj,


Thank you for writing back.

We will shortly update you on the relevant thread with the status of correction in reference to the tickets attached to it.

Hi Neeraj,

Thanks for using Aspose.Cells.

We have fixed these issues except the one highlighted in red. We could not know why the order of the legend items are difference.

  • CELLSJAVA-41045: Columns of the chart are overlapping with bottom axis
  • CELLSJAVA-41046: Chart’s legend sequence has changed ( It cannot be fixed ).
  • CELLSJAVA-41047: Data separator of stacked column chart has different thickness
  • CELLSJAVA-40987: Chart’s Axis Labels & Legend are Overlapping
  • CELLSJAVA-40988: Chart’s Data Label is Trimmed Off
  • CELLSJAVA-40989: Bar Chart has Extra Vertical Lines on Right of the Bars


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

The issues you have found earlier (filed as CELLSJAVA-41047;CELLSJAVA-41045;CELLSJAVA-40989;CELLSJAVA-40988;CELLSJAVA-40987) have been fixed in this update.


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

Hi,


Is there any chance that following issue will get fix in the forthcoming release?
  • CELLSJAVA-41046: Chart’s legend sequence has changed
Thanks,
Neeraj

Hi Neeraj,

Thanks for your posting and using Aspose.Cells.

It is difficult for us to fix this issue. However, we have logged your comment in our database against this issue i.e CELLSJAVA-41046. Please spare us some time. We will let you know if this issue can be fixed in future versions or not.

Hi Neeraj,


Here are some updates regarding the ticket CELLSJAVA-41046. As discussed earlier, we cannot fix the problem of incorrect sequence of legend entries because we are unable to understand the problem cause. Please note, Aspose.Cells APIs are unable to detect the legend position for the said chart in your provided spreadsheet due to unknown reasons.

Please execute the following statement, you will notice that the resultant value is 0.

Java

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

One workaround for this situation is to set the legend position of the chart before rendering it to the PDF format.

Java
chart1.getLegend().setPosition(LegendPositionType.LEFT);

Moreover, the legends position in x & y along with its height and width are not used. You should use the following statements to reset the aforesaid values to the original values.

Java
chart1.getLegend().setX(chart1.getLegend().getX()); chart1.getLegend().setY(chart1.getLegend().getY()); chart1.getLegend().setWidth(chart1.getLegend().getWidth()); chart1.getLegend().setHeight(chart1.getLegend().getHeight());

The above workaround will cause the legend entries to render in the same as they are in the original spreadsheet with little change in the layout.

Thank you for your understanding.

While testing CELLSJAVA-41047, it appears that white spaces, showing separation of data within the column, are still thicker as compared to the actual one (or when compared to the MS Excel generated PDF).

Attached here is the PDF generated using Aspose cells 8.5.4.2 for your reference.

Kindly zoom-in the PDF to observe the actual problem.

Thanks,
Neeraj

Hi Neeraj,

Could you please attach the source spreadsheet & resultant PDF (generated with Aspose.Cells for Java (Latest Version) here for reference?

Hi,


I have attached the required files.

Thanks,
Neeraj

Hi Neeraj,

Thank you for sharing the files. Please note, your provided PDF is generated with Aspose.Cells v8.5.2.4. Anyway we are able to see the problem while using the latest build of Aspose.Cells for Java 8.6.0.3 therefore we have reopened the previously logged ticket CELLSJAVA-41047 and have requested the product team to review the case based on the results generated with latest build of the API. Please allow us some time to look further into the matter, and get back to you with updates in this regard.