我正在使用 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
my 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。
我该如何解决这个问题?
最佳答案
@Gagravarr 感谢您的回复,我搜索的方式找不到此链接。我添加了依赖项,没有再出现错误。
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.3</version>
</dependency>
关于java - 找不到 apache poi 的类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51026963/