0

I'm encountering an issue trying to use Apache POI 5.2.3. I'm attempting to set the category axis mark interval and label.

As mentioned in another question(https://stackoverflow.com/a/66670362/2212458). The following code is supposed to handle this:

    chart.getCTChart().getPlotArea().getCatAxArray(0).addNewTickLblSkip().setVal(2); // label only every second mark
    chart.getCTChart().getPlotArea().getCatAxArray(0).addNewTickMarkSkip().setVal(2); // show only every second mark

However, this results in a build error "error: cannot access CTSkip" and "class file for org.openxmlformats.schemas.drawingml.x2006.chart.CTSkip not found".

Other portions of the namespace are accessible such as CTTitle, CTNumFormat, CTTickMark are accessible, but for some reason CTSkip is not. How do I work around this issue?

denver
  • 2,863
  • 2
  • 31
  • 45
  • What `poi-ooxml` jars are you using? – Gagravarr Oct 14 '22 at 14:01
  • @Gagravarr Library is coming from MavenCentral via gradle "implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.2.3'". This should result in poi-ooxml-5.2.3.jar getting used. – denver Oct 14 '22 at 15:49
  • 1
    Try swapping from `poi-ooxml-lite` to `poi-ooxml-full` ? – Gagravarr Oct 14 '22 at 22:47
  • @Gagravarr It does appear to be in poi-ooxml-full. Probably for convenience poi-ooxml pulled in poi-ooxml-lite automatically. In order to use poi-ooxml-full I had to explicitly exclude the poi-ooxml-lite transient dependency. Thanks. – denver Oct 15 '22 at 02:41
  • implementation 'org.apache.poi:poi-ooxml-full:5.2.3' implementation ('org.apache.poi:poi-ooxml:5.2.3') { exclude module: 'poi-ooxml-lite' } – denver Oct 15 '22 at 02:41

0 Answers0