Bug 59631

Summary: LineChart not working: lines not shown
Product: POI Reporter: Michael <michael.holtermann>
Component: XSSFAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.14-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: File rendered from org.apache.poi.xssf.usermodel.examples.LineChart
Workaround by using an empty Excel file as template
Adopted LineChart example, uses emptyTemplate.xlsx

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:varyColors val="false"/>
<c:idx val="0"/>
<c:order val="0"/>
<c:symbol val="none"/>

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