Apache POI Excel chart is disappeared on Mac but not on Windows/Linux

I've drawn an excel bar chart using Openxml.CTChart of Apache POI. The chart works fine under Linux(libreOffice) and Windows(MSOffice). But the chart is gone when the file is opened on MacOs/IOS, all other tables work still fine.

The code is long, I'd put a part of it. If you need more information please tell me.

XSSFDrawing drawing = ((XSSFSheet) sheet).createDrawingPatriarch();

ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, anchorRow, 15, anchorRow + 6 + 2 * dataSource.getTableNumber());

XSSFChart chart = drawing.createChart(anchor);

chart.getCTChartSpace().addNewSpPr().addNewSolidFill().addNewSrgbClr().setVal(new byte[]{(byte) 0xff,

(byte) 0xff, (byte) 0xff});

// chart

CTChart ctChart = chart.getCTChart();

// plotArea

CTPlotArea ctPlotArea = ctChart.getPlotArea();


Read More »

By: StackOverFlow - 6 days ago

Related Posts