gpt4 book ai didi

apache-poi - 在 POI 模式中找不到 CTBarChart

转载 作者:行者123 更新时间:2023-12-03 16:29:44 29 4
gpt4 key购买 nike

我目前正在使用 POI 使用 XSLF 编辑 PPTX 文件内嵌入图表中的数据。我找到了一个使用带有饼图的模板 ppt 的示例,效果非常好。我还尝试编辑折线图并且它有效。但是,当我尝试编辑嵌入式条形图时,我发现 CTBarChart.class 未在模式(org.openxmlformats.schemas.drawingxml.x2006.chart.CTBarChart.class)内部实现。

我想知道是否必须编写自己的 XML 解析器或查找不同的库,或者 CTBarChart 是否是 POI 内我未找到的另一个文件的一部分。

最佳答案

有一个Apache POI FAQ Entry在这个问题上!

引用常见问题解答中的重要部分:

There are two jar files available, as described in the components overview section. The full jar of all of the schemas is ooxml-schemas-1.1.jar, and it is currently around 15mb. The smaller poi-ooxml-schemas jar is only about 4mb. This latter jar file only contains the typically used parts though.

Many users choose to use the smaller poi-ooxml-schemas jar to save space. However, the poi-ooxml-schemas jar only contains the XSDs and classes that are typically used, as identified by the unit tests. Every so often, you may try to use part of the file format which isn't included in the minimal poi-ooxml-schemas jar. In this case, you should switch to the full ooxml-schemas-1.1.jar. Longer term, you may also wish to submit a new unit test which uses the extra parts of the XSDs, so that a future poi-ooxml-schemas jar will include them.

因此,短期内您需要从小 poi-ooxml-schemas jar 切换到完整的 ooxml-schemas jar。从长远来看,您需要向使用该类的 Apache POI 提交单元测试,因此它会自动包含在未来的小 jar 中

关于apache-poi - 在 POI 模式中找不到 CTBarChart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26258917/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com