]> source.dussan.org Git - poi.git/commitdiff
xddf test
authorPJ Fanning <fanningpj@apache.org>
Fri, 16 Jun 2023 19:05:58 +0000 (19:05 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 16 Jun 2023 19:05:58 +0000 (19:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1910459 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/test/java/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java
src/resources/ooxml-lite-report.clazz
src/resources/ooxml-lite-report.xsb

index 45ff5d7747269a24f0a17fd1d33b6ce34827b054..ba2eeba1537a298d165b24c2b105629c2fa7e1a6 100644 (file)
@@ -47,6 +47,36 @@ class TestXDDFChart {
         assertNotNull(xddfChart.getCTPlotArea());
     }
 
+    @Test
+    void testSetMajorUnit() {
+        // minimal test to cause ooxml-lite to include all the classes in poi-ooxml-lite
+        XDDFChart xddfChart = newXDDFChart();
+
+        XDDFValueAxis xAxis = xddfChart.createValueAxis(AxisPosition.BOTTOM);
+        XDDFValueAxis yAxis = xddfChart.createValueAxis(AxisPosition.LEFT);
+        assertNotNull(xAxis);
+        assertNotNull(yAxis);
+
+        xAxis.setTitle("Seconds Into Run");
+        final double xAxisMajorUnits = 300.0;
+        xAxis.setMajorUnit(xAxisMajorUnits);
+        assertEquals(xAxisMajorUnits, xAxis.getMajorUnit());
+        final double yAxisMajorUnits = 100.0;
+        yAxis.setMinorUnit(yAxisMajorUnits);
+        assertEquals(yAxisMajorUnits, yAxis.getMinorUnit());
+
+        xAxis.setOrientation(AxisOrientation.MAX_MIN);
+        assertEquals(AxisOrientation.MAX_MIN, xAxis.getOrientation());
+        yAxis.setOrientation(AxisOrientation.MIN_MAX);
+        assertEquals(AxisOrientation.MIN_MAX, yAxis.getOrientation());
+
+        xAxis.setCrosses(AxisCrosses.AUTO_ZERO);
+        assertEquals(AxisCrosses.AUTO_ZERO, xAxis.getCrosses());
+
+        yAxis.setCrossBetween(AxisCrossBetween.BETWEEN);
+        assertEquals(AxisCrossBetween.BETWEEN, yAxis.getCrosses());
+    }
+
     @Test
     void testSetExternalId() {
         XDDFChart xddfChart = newXDDFChart();
index 9321d717035475035c541451fc27f759cb6700fb..16c5c9d4b21ae40ffc4b6189b83b550e2e6ac6cc 100644 (file)
@@ -2523,3 +2523,5 @@ org/openxmlformats/schemas/wordprocessingml/x2006/main/impl/CTSdtContentRowImpl
 org/openxmlformats/schemas/wordprocessingml/x2006/main/CTSdtContentRow
 org/openxmlformats/schemas/drawingml/x2006/main/CTComplementTransform
 org/openxmlformats/schemas/drawingml/x2006/main/CTPositiveFixedAngle
+org/openxmlformats/schemas/drawingml/x2006/chart/impl/STAxisUnitImpl
+org/openxmlformats/schemas/drawingml/x2006/chart/STAxisUnit
index 352d65040828eae22280d05d87dd4ea45d760b56..8ae244c32ce8f449c57c6785ffcb6ca36cb11cbc 100644 (file)
@@ -1173,3 +1173,4 @@ ctbubblechart3ff4type
 ctbubblesere172type
 ctdlblpos9ce4type
 stdlblpos1cf4type
+staxisunit6cc7type