我正在使用Apache POI(3.17)创建一些带有图表的工作表。
我在使用时遇到以下问题:
XSSFChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
bottomAxis.getMajorGridLines(); // here give error
它抛出:
The type org.openxmlformats.schemas.drawingml.x2006.chart.CTChartLines cannot be resolved. It is indirectly referenced from required .class files
The method getMajorGridLines() from the type XSSFChartAxis refers to the missing type CTChartLines
The method addNewMajorGridlines() from the type CTValAx refers to the missing type CTChartLines
我的pom.xml
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
我在ooxml-schemas 1.3上找到了此类,但现在我们正在使用poi-ooxml-schemas 3.17。
我该如何解决这个问题?
答案 0 :(得分:0)
@Gagravarr感谢您的回复,我搜索的方式找不到此链接。我添加了依赖项,不再添加错误。
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.3</version>
</dependency>