diff options
author | Alain Béarez <abearez@apache.org> | 2020-01-29 06:38:22 +0000 |
---|---|---|
committer | Alain Béarez <abearez@apache.org> | 2020-01-29 06:38:22 +0000 |
commit | a3dfc463edaef1afceb12b81e802db8ba0e4b947 (patch) | |
tree | 1677512ba277596840d0ceca5ed5ce58e56e49d3 | |
parent | c6dd3af374a594cc3be5b43af2c1970e567da39d (diff) | |
download | poi-a3dfc463edaef1afceb12b81e802db8ba0e4b947.tar.gz poi-a3dfc463edaef1afceb12b81e802db8ba0e4b947.zip |
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
-rw-r--r-- | src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBar3DChartData.java | 21 | ||||
-rw-r--r-- | src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java | 21 |
2 files changed, 42 insertions, 0 deletions
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()) { |