Bug 59631 - LineChart not working: lines not shown
Summary: LineChart not working: lines not shown
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.14-FINAL
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-25 09:05 UTC by Michael
Modified: 2018-02-10 14:10 UTC (History)
0 users



Attachments
File rendered from org.apache.poi.xssf.usermodel.examples.LineChart (5.37 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-05-25 09:05 UTC, Michael
Details
Workaround by using an empty Excel file as template (7.50 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-06-09 10:12 UTC, Michael
Details
Adopted LineChart example, uses emptyTemplate.xlsx (3.87 KB, text/x-java)
2016-06-09 10:13 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2016-05-25 09:05:05 UTC
Created attachment 33887 [details]
File rendered from org.apache.poi.xssf.usermodel.examples.LineChart

I'm trying to create a Line Chart following the example in org.apache.poi.xssf.usermodel.examples.LineChart.

Unfortunately, the rendered XLSX will contain a LineChart that's not readable. I'll attach the file.

You may clik through the chart, select the line and apply some styling in Excel or LibreOffice.

I think there's something wrong within 'chart1.xml', somewhere near 
<c:lineChart>
<c:varyColors val="false"/>
<c:ser>
<c:idx val="0"/>
<c:order val="0"/>
<c:marker>
<c:symbol val="none"/>
</c:marker>

It seams the Chart API does not contain any possiblity to style the chart, do it?

Regards, Michael
Comment 1 Michael 2016-06-09 10:12:49 UTC
Created attachment 33928 [details]
Workaround by using an empty Excel file as template

I've found a workaround:
1. create an empty Excel file and save it
2. use that file as "template" in "new XSSFWorkbook(file)"

Now the chart contains some styling, the lines are visible.

I'll attach the template file and a slightly adopted "org.apache.poi.xssf.usermodel.examples.LineChart".
Comment 2 Michael 2016-06-09 10:13:18 UTC
Created attachment 33929 [details]
Adopted LineChart example, uses emptyTemplate.xlsx
Comment 3 Alain Fagot Bearez 2018-02-10 14:10:46 UTC
Styling the charts has been introduced in r1820369 by defining XDDFShapeProperties.

An example can be found in example 
org.apache.poi.xssf.usermodel.examples.BarChart