]> source.dussan.org Git - poi.git/commitdiff
Invert bar chart if negative by Niklas Mollenhauer
authorAlain Béarez <abearez@apache.org>
Wed, 29 Jan 2020 06:38:22 +0000 (06:38 +0000)
committerAlain Béarez <abearez@apache.org>
Wed, 29 Jan 2020 06:38:22 +0000 (06:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1873282 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBar3DChartData.java
src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java

index 666802b1fa21db0c5c5a66d90ce7490dc2131efa..263e8c1324568a803222e0bba09c2939b83a65ef 100644 (file)
@@ -251,6 +251,27 @@ public class XDDFBar3DChartData extends XDDFChartData {
             }
         }
 
+        /**
+         * @since 4.1.2
+         */
+        public boolean getInvertIfNegative() {
+            if (series.isSetInvertIfNegative()) {
+                return series.getInvertIfNegative().getVal();
+            }
+            return false;
+        }
+
+        /**
+         * @since 4.1.2
+         */
+        public void setInvertIfNegative(boolean invertIfNegative) {
+            if (series.isSetInvertIfNegative()) {
+                series.getInvertIfNegative().setVal(invertIfNegative);
+            } else {
+                series.addNewInvertIfNegative().setVal(invertIfNegative);
+            }
+        }
+
         @Override
         public void setShowLeaderLines(boolean showLeaderLines) {
             if (!series.isSetDLbls()) {
index 4261212d333f4cc0938b71717fc1453cf9fb1314..85f75ffe5f6f7aef37b66153f13301fe14ba7143 100644 (file)
@@ -241,6 +241,27 @@ public class XDDFBarChartData extends XDDFChartData {
             }
         }
 
+        /**
+         * @since 4.1.2
+         */
+        public boolean getInvertIfNegative() {
+            if (series.isSetInvertIfNegative()) {
+                return series.getInvertIfNegative().getVal();
+            }
+            return false;
+        }
+
+        /**
+         * @since 4.1.2
+         */
+        public void setInvertIfNegative(boolean invertIfNegative) {
+            if (series.isSetInvertIfNegative()) {
+                series.getInvertIfNegative().setVal(invertIfNegative);
+            } else {
+                series.addNewInvertIfNegative().setVal(invertIfNegative);
+            }
+        }
+
         @Override
         public void setShowLeaderLines(boolean showLeaderLines) {
             if (!series.isSetDLbls()) {