From: Alain BĂ©arez Date: Wed, 29 Jan 2020 06:38:22 +0000 (+0000) Subject: Invert bar chart if negative by Niklas Mollenhauer X-Git-Tag: REL_4_1_2~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a3dfc463edaef1afceb12b81e802db8ba0e4b947;p=poi.git Invert bar chart if negative by Niklas Mollenhauer git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1873282 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBar3DChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBar3DChartData.java index 666802b1fa..263e8c1324 100644 --- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBar3DChartData.java +++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBar3DChartData.java @@ -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()) { diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java index 4261212d33..85f75ffe5f 100644 --- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java +++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java @@ -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()) {