Problem with the creation of a chart LINE on XLSX file

Hello,

I want to create a simple Chart, of type “Line”. Unfortunately, when I save my Excel file as a XSLX format, the chart type is “Line with data markers” and not “Line”.

To create the Chart, I use the following code:

Workbook workbook = new Workbook();
Worksheet ws = workbook.getWorksheets().getSheet(0);
Cells cells = ws.getCells();
cells.getCell(“A1”).setValue(1);
cells.getCell(“A2”).setValue(2);
cells.getCell(“A3”).setValue(3);
cells.getCell(“A4”).setValue(4);
cells.getCell(“B1”).setValue(4);
cells.getCell(“B2”).setValue(7);
cells.getCell(“B3”).setValue(6);
cells.getCell(“B4”).setValue(7);
// Create the Chart
Chart chart = ws.getCharts().addChart(ChartType.LINE, 5, 1, 15, 5);
chart.getNSeries().add(“A1:B4”, true);
workbook.save(“c:\test.xls”, FileFormatType.EXCEL97TO2003); // In XLS, it is correct
workbook.save(“c:\test.xlsx”, FileFormatType.XLSX); // In XLSX, the type of chart is not correct

The chart on the Excel 97/2003 is correct.
I am using Aspose Cells v2.5.3.8, Java 1.6 and Excel 2007 sp2.

You can find the two Excel files generated attached to this post.

What am I doing wrong?

Thanks in advance.

Hi,


Thank you for bringing this to our knowledge.
We are able to reproduce your said issue, so we have logged it in our bug tracking system under Ticket ID CELLSJAVA-27932. Soon we will update you on this.

Hi,

Thanks for reporting.

I was able to reproduce this issue with Aspose.Cells for Java v2.5.3.8. We will fix it as soon as possible.

This issue has been logged as CELLSJAVA-27933.

Thanks for your quick reply.

However, be carefull as you created 2 defects for the same issue :slight_smile:

Hi,

Thanks for your posting.

No problem, these issues have been marked as related and duplicate in our database.

Hi,


We have fixed your said issue in latest fix version of Aspose.Cells for JAVA v2.5.4.1 [attached]. Please try your requirement with this new JAR and let us know of your feedback.
Thank you.

Hello,

I’ve tried with 2.5.4.1 version, and the problem is now solved!

Thanks again.

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


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