aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlain Béarez <abearez@apache.org>2021-02-17 22:05:18 +0000
committerAlain Béarez <abearez@apache.org>2021-02-17 22:05:18 +0000
commitb20ca985b810fa455550a7271cce7e1e21a65033 (patch)
treeca48710582c2bc839724ea9d07d7b48600381b5c /src
parent36277f9e5446c2ada6710fb779c9a66ec84fb0fc (diff)
downloadpoi-b20ca985b810fa455550a7271cce7e1e21a65033.tar.gz
poi-b20ca985b810fa455550a7271cce7e1e21a65033.zip
Manipulate individual data point properties
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886642 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/examples/src/org/apache/poi/examples/xslf/PieChartDemo.java1
-rw-r--r--src/examples/src/org/apache/poi/examples/xssf/usermodel/BarAndLineChart.java11
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFArea3DChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFAreaChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBar3DChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java50
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataPoint.java164
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDoughnutChartData.java8
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLine3DChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPie3DChartData.java8
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java8
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurface3DChartData.java7
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurfaceChartData.java9
-rw-r--r--src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java1
18 files changed, 319 insertions, 4 deletions
diff --git a/src/examples/src/org/apache/poi/examples/xslf/PieChartDemo.java b/src/examples/src/org/apache/poi/examples/xslf/PieChartDemo.java
index 8bcd014769..5f3d6470c8 100644
--- a/src/examples/src/org/apache/poi/examples/xslf/PieChartDemo.java
+++ b/src/examples/src/org/apache/poi/examples/xslf/PieChartDemo.java
@@ -110,6 +110,7 @@ public final class PieChartDemo {
firstSeries.replaceData(categoriesData, valuesData);
firstSeries.setTitle(chartTitle, chart.setSheetTitle(chartTitle, 0));
firstSeries.setExplosion(25L);
+ firstSeries.getDataPoint(1).setExplosion(35L);
chart.plot(pie);
// save the result
diff --git a/src/examples/src/org/apache/poi/examples/xssf/usermodel/BarAndLineChart.java b/src/examples/src/org/apache/poi/examples/xssf/usermodel/BarAndLineChart.java
index e5cf0542b0..32329f2c29 100644
--- a/src/examples/src/org/apache/poi/examples/xssf/usermodel/BarAndLineChart.java
+++ b/src/examples/src/org/apache/poi/examples/xssf/usermodel/BarAndLineChart.java
@@ -166,10 +166,15 @@ public final class BarAndLineChart {
// some colors
XDDFFillProperties solidChartreuse = new XDDFSolidFillProperties(XDDFColor.from(PresetColor.CHARTREUSE));
XDDFFillProperties solidTurquoise = new XDDFSolidFillProperties(XDDFColor.from(PresetColor.TURQUOISE));
- XDDFLineProperties solidLines = new XDDFLineProperties(solidTurquoise);
+ XDDFLineProperties linesChartreuse = new XDDFLineProperties(solidChartreuse);
+ XDDFLineProperties linesTurquoise = new XDDFLineProperties(solidTurquoise);
series1.setFillProperties(solidChartreuse);
- series1.setLineProperties(solidLines); // bar border color different from fill
- series2.setLineProperties(solidLines);
+ series1.setLineProperties(linesTurquoise); // bar border color different from fill
+ series1.getDataPoint(2).setFillProperties(solidTurquoise); // this specific bar has inverted colors
+ series1.getDataPoint(2).setLineProperties(linesChartreuse);
+ series2.setLineProperties(linesTurquoise);
+ series2.getDataPoint(2).setMarkerStyle(MarkerStyle.STAR);
+ series2.getDataPoint(2).setLineProperties(linesChartreuse);
// legend
XDDFChartLegend legend = chart.getOrAddLegend();
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFArea3DChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFArea3DChartData.java
index c94cb32381..ebc0ee6305 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFArea3DChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFArea3DChartData.java
@@ -17,6 +17,7 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.ooxml.util.POIXMLUnits;
@@ -26,6 +27,7 @@ import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTArea3DChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
@@ -212,5 +214,10 @@ public class XDDFArea3DChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFAreaChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFAreaChartData.java
index 1d67f10686..e09121225c 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFAreaChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFAreaChartData.java
@@ -17,6 +17,7 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.util.Beta;
@@ -25,6 +26,7 @@ import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
@@ -193,5 +195,10 @@ public class XDDFAreaChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
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 6c52b8e30f..3f6984f6e4 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
@@ -17,6 +17,7 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.ooxml.util.POIXMLUnits;
@@ -26,6 +27,7 @@ import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBar3DChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBarSer;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
@@ -320,5 +322,10 @@ public class XDDFBar3DChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
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 25eb5d97e2..9ff0bc0d94 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
@@ -17,6 +17,7 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.ooxml.util.POIXMLUnits;
@@ -26,6 +27,7 @@ import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBarChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBarSer;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
@@ -310,5 +312,10 @@ public class XDDFBarChartData extends XDDFChartData {
protected void setOrder(long order) {
series.getOrder().setVal(order);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java
index 225749f508..365d3f37fd 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java
@@ -30,6 +30,7 @@ import org.apache.poi.xddf.usermodel.XDDFFillProperties;
import org.apache.poi.xddf.usermodel.XDDFLineProperties;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumData;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumRef;
@@ -157,6 +158,8 @@ public abstract class XDDFChartData {
protected abstract void setOrder(long order);
+ protected abstract List<CTDPt> getDPtList();
+
protected Series(XDDFDataSource<?> category, XDDFNumericalDataSource<? extends Number> values) {
replaceData(category, values);
}
@@ -251,6 +254,53 @@ public abstract class XDDFChartData {
setShapeProperties(properties);
}
+ /**
+ * If a data point definition with the given <code>index</code> exists, then remove it.
+ * Otherwise do nothing.
+ *
+ * @param index
+ * data point index.
+ * @since POI 5.0.1
+ */
+ public void clearDataPoint(long index) {
+ List<CTDPt> points = getDPtList();
+ for (int i = 0; i < points.size(); i++) {
+ if (points.get(i).getIdx().getVal() == index) {
+ points.remove(i);
+ i = points.size();
+ }
+ }
+ }
+
+ /**
+ * If a data point definition with the given <code>index</code> exists, then return it.
+ * Otherwise create a new data point definition and return it.
+ *
+ * @param index
+ * data point index.
+ * @return
+ * the data point with the given <code>index</code>.
+ * @since POI 5.0.1
+ */
+ public XDDFDataPoint getDataPoint(long index) {
+ List<CTDPt> points = getDPtList();
+ for (int i = 0; i < points.size(); i++) {
+ if (points.get(i).getIdx().getVal() == index) {
+ return new XDDFDataPoint(points.get(i));
+ }
+ if (points.get(i).getIdx().getVal() > index) {
+ points.add(i, CTDPt.Factory.newInstance());
+ CTDPt point = points.get(i);
+ point.addNewIdx().setVal(index);
+ return new XDDFDataPoint(point);
+ }
+ }
+ points.add(CTDPt.Factory.newInstance());
+ CTDPt point = points.get(points.size() - 1);
+ point.addNewIdx().setVal(index);
+ return new XDDFDataPoint(point);
+ }
+
private CTNumData retrieveNumCache(final CTAxDataSource axDataSource, XDDFDataSource<?> data) {
CTNumData numCache;
if (data.isReference()) {
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataPoint.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataPoint.java
new file mode 100644
index 0000000000..01c8660090
--- /dev/null
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataPoint.java
@@ -0,0 +1,164 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.apache.poi.xddf.usermodel.chart;
+
+import org.apache.poi.util.Beta;
+import org.apache.poi.util.Internal;
+import org.apache.poi.xddf.usermodel.XDDFFillProperties;
+import org.apache.poi.xddf.usermodel.XDDFLineProperties;
+import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTMarker;
+
+/**
+ * @since 5.0.1
+ */
+@Beta
+public class XDDFDataPoint {
+ private final CTDPt point;
+
+ @Internal
+ protected XDDFDataPoint(CTDPt point) {
+ this.point = point;
+ }
+
+ public long getIndex() {
+ return point.getIdx().getVal();
+ }
+
+ /**
+ * @param fill
+ * fill property for the shape representing the point.
+ */
+ public void setFillProperties(XDDFFillProperties fill) {
+ XDDFShapeProperties properties = getShapeProperties();
+ if (properties == null) {
+ properties = new XDDFShapeProperties();
+ }
+ properties.setFillProperties(fill);
+ setShapeProperties(properties);
+ }
+
+ /**
+ * @param line
+ * line property for the shape representing the point.
+ */
+ public void setLineProperties(XDDFLineProperties line) {
+ XDDFShapeProperties properties = getShapeProperties();
+ if (properties == null) {
+ properties = new XDDFShapeProperties();
+ }
+ properties.setLineProperties(line);
+ setShapeProperties(properties);
+ }
+
+ public XDDFShapeProperties getShapeProperties() {
+ if (point.isSetSpPr()) {
+ return new XDDFShapeProperties(point.getSpPr());
+ } else {
+ return null;
+ }
+ }
+
+ public void setShapeProperties(XDDFShapeProperties properties) {
+ if (properties == null) {
+ if (point.isSetSpPr()) {
+ point.unsetSpPr();
+ }
+ } else {
+ if (point.isSetSpPr()) {
+ point.setSpPr(properties.getXmlObject());
+ } else {
+ point.addNewSpPr().set(properties.getXmlObject());
+ }
+ }
+ }
+
+ public Long getExplosion() {
+ if (point.isSetExplosion()) {
+ return point.getExplosion().getVal();
+ } else {
+ return null;
+ }
+ }
+
+ public void setExplosion(Long explosion) {
+ if (explosion == null) {
+ if (point.isSetExplosion()) {
+ point.unsetExplosion();
+ }
+ } else {
+ if (point.isSetExplosion()) {
+ point.getExplosion().setVal(explosion);
+ } else {
+ point.addNewExplosion().setVal(explosion);
+ }
+ }
+ }
+
+ public boolean getInvertIfNegative() {
+ if (point.isSetInvertIfNegative()) {
+ return point.getInvertIfNegative().getVal();
+ }
+ return false;
+ }
+
+ public void setInvertIfNegative(boolean invertIfNegative) {
+ if (point.isSetInvertIfNegative()) {
+ point.getInvertIfNegative().setVal(invertIfNegative);
+ } else {
+ point.addNewInvertIfNegative().setVal(invertIfNegative);
+ }
+ }
+
+ /**
+ * @param size
+ * <dl><dt>Minimum inclusive:</dt><dd>2</dd><dt>Maximum inclusive:</dt><dd>72</dd></dl>
+ */
+ public void setMarkerSize(short size) {
+ if (size < 2 || 72 < size) {
+ throw new IllegalArgumentException("Minimum inclusive: 2; Maximum inclusive: 72");
+ }
+ CTMarker marker = getMarker();
+ if (marker.isSetSize()) {
+ marker.getSize().setVal(size);
+ } else {
+ marker.addNewSize().setVal(size);
+ }
+ }
+
+ public void setMarkerStyle(MarkerStyle style) {
+ CTMarker marker = getMarker();
+ if (marker.isSetSymbol()) {
+ marker.getSymbol().setVal(style.underlying);
+ } else {
+ marker.addNewSymbol().setVal(style.underlying);
+ }
+ }
+
+ private CTMarker getMarker() {
+ if (point.isSetMarker()) {
+ return point.getMarker();
+ } else {
+ return point.addNewMarker();
+ }
+ }
+
+}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDoughnutChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDoughnutChartData.java
index 64f22d7ec7..23020f842a 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDoughnutChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDoughnutChartData.java
@@ -17,11 +17,14 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
+
import org.apache.poi.ooxml.util.POIXMLUnits;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTDoughnutChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieSer;
@@ -225,5 +228,10 @@ public class XDDFDoughnutChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLine3DChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLine3DChartData.java
index db55a7a31e..2f2e6fa738 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLine3DChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLine3DChartData.java
@@ -17,6 +17,7 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.ooxml.util.POIXMLUnits;
@@ -24,6 +25,7 @@ import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTLine3DChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineSer;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTMarker;
@@ -299,5 +301,10 @@ public class XDDFLine3DChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java
index 17bf971584..34bad10619 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java
@@ -17,12 +17,14 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineSer;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTMarker;
@@ -282,5 +284,10 @@ public class XDDFLineChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPie3DChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPie3DChartData.java
index b7a8092adb..d2a5059847 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPie3DChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPie3DChartData.java
@@ -17,10 +17,13 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
+
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPie3DChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieSer;
@@ -174,5 +177,10 @@ public class XDDFPie3DChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java
index 2d5cff7eee..6a3a28c576 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java
@@ -17,10 +17,13 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
+
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieSer;
@@ -199,5 +202,10 @@ public class XDDFPieChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java
index 7a2159dfb6..f7f2edac6d 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java
@@ -17,12 +17,14 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTRadarChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTRadarSer;
@@ -184,5 +186,10 @@ public class XDDFRadarChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java
index 7e27ff9e2d..bb500cd20f 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java
@@ -17,12 +17,14 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTMarker;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterChart;
@@ -292,5 +294,10 @@ public class XDDFScatterChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ return series.getDPtList();
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurface3DChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurface3DChartData.java
index 819ef1e2a3..982a104632 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurface3DChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurface3DChartData.java
@@ -17,12 +17,14 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSurface3DChart;
@@ -186,5 +188,10 @@ public class XDDFSurface3DChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ throw new IllegalStateException("Surface data series don't support data point settings.");
+ }
}
}
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurfaceChartData.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurfaceChartData.java
index b3e98563f7..25e8fad31c 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurfaceChartData.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSurfaceChartData.java
@@ -17,12 +17,14 @@
package org.apache.poi.xddf.usermodel.chart;
+import java.util.List;
import java.util.Map;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTDPt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTSurfaceChart;
@@ -186,5 +188,10 @@ public class XDDFSurfaceChartData extends XDDFChartData {
protected void setOrder(long val) {
series.getOrder().setVal(val);
}
+
+ @Override
+ protected List<CTDPt> getDPtList() {
+ throw new IllegalStateException("Surface data series don't support data point settings.");
+ }
}
-} \ No newline at end of file
+}
diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java
index 0f458b6524..bc235f51b5 100644
--- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java
+++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java
@@ -178,6 +178,7 @@ class TestNecessaryOOXMLClasses {
assertNotNull(CTErrValType.Factory.newInstance());
assertNotNull(CTErrDir.Factory.newInstance());
assertNotNull(CTHoleSize.Factory.newInstance());
+ assertNotNull(CTDPt.Factory.newInstance());
STErrBarType.Enum e9 = STErrBarType.Enum.forString("both");
assertNotNull(e9);