Is there a way to use Apache POI to extract the following information (preferably all the info):
- title (including position + style)
- axes (including position + style)
- series/ data ranges (including position + style)
- legend (including position + style)
for the following charts:
- High low close chart
- open high low close chart
- volume high low close chart
- volume open high low close chart
- box and whisker chart
- funnel chart
- paretoline chart
- region map chart
- sunburst chart
- treemap chart
- waterfall
All your listed charts seems to be of extended chart type which is not available in versions of Office Open XML up to year 2007. But those old versions of Office Open XML is what Apache POI is developed on.
The extended chart is not a
XSSFChart.XSSFChartis of typeapplication/vnd.openxmlformats-officedocument.drawingml.chart+xmlwhile extended chart is of typeapplication/vnd.ms-office.chartex+xml.But we can using at least parts of apache poi and have to program the
XSSFChartExclass our own instead theXSSFChartthen. Unfortunately also a classXSSFChartExRelationis needed because such a relation class of course also not exists already.In
XSSFChartExclass we can have getters for needed parts as title, series, legend, axes then. Simplest will be to get the XML of the parts asXmlObject.Complete example:
The real challenge is to find out the meaning of the found XML. Fortunately most of the XML element names are self-explanatory. So one should be able to find out where is the title text for example. But to get the meaning of series settings, legend settings and axes settings can be challenging.