【发布时间】:2018-06-26 03:00:34
【问题描述】:
我正在使用 Apache POI (3.17) 创建一些带有图表的工作表。
我在使用时遇到以下问题:
XSSFChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
bottomAxis.getMajorGridLines(); // here give error
它抛出:
XSSFChartAxis 类型中的方法 getMajorGridLines() 指的是缺少的类型 CTChartLines
CTValAx 类型中的方法 addNewMajorGridlines() 指的是缺少的类型 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。
我该如何解决这个问题?
【问题讨论】:
-
@Gagravarr 感谢您的回复,我搜索的方式找不到此链接。我添加了依赖项,没有更多的错误。
<dependency> <groupId>org.apache.poi</groupId> <artifactId>ooxml-schemas</artifactId> <version>1.3</version> </dependency>
标签: java apache-poi