Author: abearez
Date: Sun Nov 26 14:03:01 2017
New Revision: 1816383
URL: http://svn.apache.org/viewvc?rev=1816383&view=rev
Log:
XDDF usermodel for Charts closes #68 on GitHub
Added:
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-template.pptx
poi/trunk/src/ooxml/java/org/apache/poi/xddf/
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrossBetween.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrosses.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisLabelAlignment.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisOrientation.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisPosition.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickLabelPosition.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickMark.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarDirection.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarGrouping.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/ChartTypes.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/Grouping.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/LayoutMode.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/LayoutTarget.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/LegendPosition.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/MarkerStyle.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/RadarStyle.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/ScatterStyle.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFCategoryAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFCategoryDataSource.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChart.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartExtensionList.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartLegend.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataSource.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataSourcesFactory.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDateAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLegendEntry.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFManualLayout.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFNumericalDataSource.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFValueAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/text/
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/text/XDDFTextBody.java
- copied, changed from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFDataSourcesFactory.java
poi/trunk/test-data/slideshow/bar-chart.pptx
poi/trunk/test-data/slideshow/line-chart.pptx
poi/trunk/test-data/slideshow/radar-chart.pptx
poi/trunk/test-data/slideshow/scatter-chart.pptx
Modified:
poi/trunk/build.xml
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/Chart.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/Drawing.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrossBetween.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrosses.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisPosition.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisTickMark.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxis.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxisFactory.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartData.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataFactory.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataSource.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutMode.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutTarget.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LegendPosition.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManualLayout.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManuallyPositionable.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ValueAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFChart.java
poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java
poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFDrawing.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChart.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSeries.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFCategoryAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFChartAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFChartDataFactory.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFChartLegend.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFChartUtil.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFDateAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFValueAxis.java
poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFChart.java
poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChart.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFCategoryAxis.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartLegend.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartTitle.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFDateAxis.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFManualLayout.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFValueAxis.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java
Modified: poi/trunk/build.xml
URL:
http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/build.xml (original)
+++ poi/trunk/build.xml Sun Nov 26 14:03:01 2017
@@ -2051,7 +2051,7 @@ under the License.
<exclude
name="resources/main/org/apache/poi/sl/draw/geom/presetShapeDefinitions.xml" />
<exclude
name="resources/ooxml/org/apache/poi/xssf/usermodel/presetTableStyles.xml" />
<exclude name="ooxml/resources/org/apache/poi/xdgf/visio.xsd" />
- <exclude
name="examples/src/org/apache/poi/xslf/usermodel/pie-chart-data.txt" />
+ <exclude
name="examples/src/org/apache/poi/xslf/usermodel/*-chart-data.txt" />
<exclude name="**/*.iml" />
<exclude name="documentation/resources/images/pb-poi.cdr"/>
<exclude name="scratchpad/models/poi-hdf.zargo"/>
Added:
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java?rev=1816383&view=auto
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
(added)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,145 @@
+/*
+ * ====================================================================
+ * 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.xslf.usermodel;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.poi.POIXMLDocumentPart;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xddf.usermodel.chart.AxisOrientation;
+import org.apache.poi.xddf.usermodel.chart.AxisPosition;
+import org.apache.poi.xddf.usermodel.chart.BarDirection;
+import org.apache.poi.xddf.usermodel.chart.XDDFBarChartData;
+import org.apache.poi.xddf.usermodel.chart.XDDFChartData;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSource;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSourcesFactory;
+import org.apache.poi.xddf.usermodel.chart.XDDFNumericalDataSource;
+
+/**
+ * Build a bar chart from a template pptx
+ */
+public class BarChartDemo {
+ private static void usage(){
+ System.out.println("Usage: BarChartDemo <bar-chart-template.pptx>
<bar-chart-data.txt>");
+ System.out.println(" bar-chart-template.pptx template with a
bar chart");
+ System.out.println(" bar-chart-data.txt the model to set.
First line is chart title, " +
+ "then go pairs {axis-label value}");
+ }
+
+ public static void main(String[] args) throws Exception {
+ if(args.length < 2) {
+ usage();
+ return;
+ }
+
+ BufferedReader modelReader = new BufferedReader(new
FileReader(args[1]));
+ XMLSlideShow pptx = null;
+ try {
+ String chartTitle = modelReader.readLine(); // first line is
chart title
+
+ // Category Axis Data
+ List<String> listCategories = new ArrayList<String>(3);
+
+ // Values
+ List<Double> listValues = new ArrayList<Double>(3);
+
+ // set model
+ String ln;
+ while((ln = modelReader.readLine()) != null){
+ String[] vals = ln.split("\\s+");
+ listCategories.add(vals[0]);
+ listValues.add(Double.valueOf(vals[1]));
+ }
+ String[] categories = listCategories.toArray(new
String[listCategories.size()]);
+ Double[] values = listValues.toArray(new
Double[listValues.size()]);
+
+ pptx = new XMLSlideShow(new FileInputStream(args[0]));
+ XSLFSlide slide = pptx.getSlides().get(0);
+ setBarData(findChart(slide), chartTitle, categories, values);
+
+ XSLFChart chart =
findChart(pptx.createSlide().importContent(slide));
+ setColumnData(chart, "Column variant");
+
+ // save the result
+ OutputStream out = new
FileOutputStream("bar-chart-demo-output.pptx");
+ try {
+ pptx.write(out);
+ } finally {
+ out.close();
+ }
+ } finally {
+ if (pptx != null) {
+ pptx.close();
+ }
+ modelReader.close();
+ }
+ }
+
+ private static void setBarData(XSLFChart chart, String chartTitle,
String[] categories, Double[] values) {
+ final List<XDDFChartData> series = chart.getChartSeries();
+ final XDDFBarChartData bar = (XDDFBarChartData) series.get(0);
+
+ final int numOfPoints = categories.length;
+ final String categoryDataRange = chart.formatRange(new
CellRangeAddress(1, numOfPoints, 0, 0));
+ final String valuesDataRange = chart.formatRange(new
CellRangeAddress(1, numOfPoints, 1, 1));
+ final XDDFDataSource<?> categoriesData =
XDDFDataSourcesFactory.fromArray(categories, categoryDataRange);
+ final XDDFNumericalDataSource<? extends Number> valuesData =
XDDFDataSourcesFactory.fromArray(values, valuesDataRange);
+
+ bar.getSeries().get(0).replaceData(categoriesData, valuesData);
+ bar.getSeries().get(0).setTitle(chartTitle,
chart.setSheetTitle(chartTitle));
+ chart.plot(bar);
+ }
+
+ private static void setColumnData(XSLFChart chart, String chartTitle) {
+ // Series Text
+ List<XDDFChartData> series = chart.getChartSeries();
+ XDDFBarChartData bar = (XDDFBarChartData) series.get(0);
+ bar.getSeries().get(0).setTitle(chartTitle,
chart.setSheetTitle(chartTitle));
+
+ // in order to transform a bar chart into a column chart, you just
need to change the bar direction
+ bar.setBarDirection(BarDirection.COL);
+
+ // additionally, you can adjust the axes
+ bar.getCategoryAxis().setOrientation(AxisOrientation.MAX_MIN);
+ bar.getValueAxes().get(0).setPosition(AxisPosition.TOP);
+ }
+
+ private static XSLFChart findChart(XSLFSlide slide) {
+ // find chart in the slide
+ XSLFChart chart = null;
+ for(POIXMLDocumentPart part : slide.getRelations()){
+ if(part instanceof XSLFChart){
+ chart = (XSLFChart) part;
+ break;
+ }
+ }
+
+ if(chart == null) {
+ throw new IllegalStateException("chart not found in the template");
+ }
+ return chart;
+ }
+}
Modified:
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
(original)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
Sun Nov 26 14:03:01 2017
@@ -19,34 +19,24 @@
package org.apache.poi.xslf.usermodel;
-import org.apache.poi.POIXMLDocumentPart;
-import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.ss.util.CellReference;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTChart;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumData;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumVal;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieChart;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieSer;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTStrData;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTStrVal;
-
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.poi.POIXMLDocumentPart;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xddf.usermodel.chart.XDDFChartData;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSource;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSourcesFactory;
+import org.apache.poi.xddf.usermodel.chart.XDDFNumericalDataSource;
+import org.apache.poi.xddf.usermodel.chart.XDDFPieChartData;
/**
* Build a pie chart from a template pptx
- *
- * @author Yegor Kozlov
*/
public class PieChartDemo {
private static void usage(){
@@ -77,74 +67,45 @@ public class PieChartDemo {
}
}
- if (chart == null) throw new IllegalStateException("chart not
found in the template");
-
- // embedded Excel workbook that holds the chart data
- POIXMLDocumentPart xlsPart = chart.getRelations().get(0);
- try (XSSFWorkbook wb = new XSSFWorkbook()) {
- XSSFSheet sheet = wb.createSheet();
-
- CTChart ctChart = chart.getCTChart();
- CTPlotArea plotArea = ctChart.getPlotArea();
-
- CTPieChart pieChart = plotArea.getPieChartArray(0);
- //Pie Chart Series
- CTPieSer ser = pieChart.getSerArray(0);
-
- // Series Text
- CTSerTx tx = ser.getTx();
-
tx.getStrRef().getStrCache().getPtArray(0).setV(chartTitle);
- sheet.createRow(0).createCell(1).setCellValue(chartTitle);
- String titleRef = new CellReference(sheet.getSheetName(),
0, 1, true, true).formatAsString();
- tx.getStrRef().setF(titleRef);
-
- // Category Axis Data
- CTAxDataSource cat = ser.getCat();
- CTStrData strData = cat.getStrRef().getStrCache();
-
- // Values
- CTNumDataSource val = ser.getVal();
- CTNumData numData = val.getNumRef().getNumCache();
-
- strData.setPtArray(null); // unset old axis text
- numData.setPtArray(null); // unset old values
-
- // set model
- int idx = 0;
- int rownum = 1;
- String ln;
- while ((ln = modelReader.readLine()) != null) {
- String[] vals = ln.split("\\s+");
- CTNumVal numVal = numData.addNewPt();
- numVal.setIdx(idx);
- numVal.setV(vals[1]);
-
- CTStrVal sVal = strData.addNewPt();
- sVal.setIdx(idx);
- sVal.setV(vals[0]);
-
- idx++;
- XSSFRow row = sheet.createRow(rownum++);
- row.createCell(0).setCellValue(vals[0]);
-
row.createCell(1).setCellValue(Double.valueOf(vals[1]));
- }
- numData.getPtCount().setVal(idx);
- strData.getPtCount().setVal(idx);
-
- String numDataRange = new CellRangeAddress(1, rownum - 1,
1, 1).formatAsString(sheet.getSheetName(), true);
- val.getNumRef().setF(numDataRange);
- String axisDataRange = new CellRangeAddress(1, rownum - 1,
0, 0).formatAsString(sheet.getSheetName(), true);
- cat.getStrRef().setF(axisDataRange);
-
- // updated the embedded workbook with the data
- try (OutputStream xlsOut =
xlsPart.getPackagePart().getOutputStream()) {
- wb.write(xlsOut);
- }
-
- // save the result
- try (OutputStream out = new
FileOutputStream("pie-chart-demo-output.pptx")) {
- pptx.write(out);
- }
+ if(chart == null) {
+ throw new IllegalStateException("chart not found in the
template");
+ }
+
+ // Series Text
+ List<XDDFChartData> series = chart.getChartSeries();
+ XDDFPieChartData pie = (XDDFPieChartData) series.get(0);
+
+ // Category Axis Data
+ List<String> listCategories = new ArrayList<String>(3);
+
+ // Values
+ List<Double> listValues = new ArrayList<Double>(3);
+
+ // set model
+ String ln;
+ while((ln = modelReader.readLine()) != null){
+ String[] vals = ln.split("\\s+");
+ listCategories.add(vals[0]);
+ listValues.add(Double.valueOf(vals[1]));
+ }
+ String[] categories = listCategories.toArray(new
String[listCategories.size()]);
+ Double[] values = listValues.toArray(new
Double[listValues.size()]);
+
+ final int numOfPoints = categories.length;
+ final String categoryDataRange = chart.formatRange(new
CellRangeAddress(1, numOfPoints, 0, 0));
+ final String valuesDataRange = chart.formatRange(new
CellRangeAddress(1, numOfPoints, 1, 1));
+ final XDDFDataSource<?> categoriesData =
XDDFDataSourcesFactory.fromArray(categories, categoryDataRange);
+ final XDDFNumericalDataSource<? extends Number> valuesData
= XDDFDataSourcesFactory.fromArray(values, valuesDataRange);
+
+ XDDFPieChartData.Series firstSeries =
(XDDFPieChartData.Series) pie.getSeries().get(0);
+ firstSeries.replaceData(categoriesData, valuesData);
+ firstSeries.setTitle(chartTitle,
chart.setSheetTitle(chartTitle));
+ firstSeries.setExplosion(25);
+ chart.plot(pie);
+
+ // save the result
+ try (OutputStream out = new
FileOutputStream("pie-chart-demo-output.pptx")) {
+ pptx.write(out);
}
}
}
Added:
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt?rev=1816383&view=auto
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt
(added)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,4 @@
+My Bar or Column Chart
+First 1.0
+Second 3.0
+Third 4.0
\ No newline at end of file
Added:
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-template.pptx
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-template.pptx?rev=1816383&view=auto
==============================================================================
Binary files
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-template.pptx
(added) and
poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-template.pptx
Sun Nov 26 14:03:01 2017 differ
Modified:
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
---
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
(original)
+++
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
Sun Nov 26 14:03:01 2017
@@ -20,22 +20,23 @@ import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Chart;
-import org.apache.poi.ss.usermodel.ClientAnchor;
-import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.usermodel.charts.AxisCrosses;
-import org.apache.poi.ss.usermodel.charts.AxisPosition;
-import org.apache.poi.ss.usermodel.charts.ChartAxis;
-import org.apache.poi.ss.usermodel.charts.ChartDataSource;
-import org.apache.poi.ss.usermodel.charts.ChartLegend;
-import org.apache.poi.ss.usermodel.charts.DataSources;
-import org.apache.poi.ss.usermodel.charts.LegendPosition;
-import org.apache.poi.ss.usermodel.charts.LineChartData;
-import org.apache.poi.ss.usermodel.charts.ValueAxis;
import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xddf.usermodel.chart.AxisCrosses;
+import org.apache.poi.xddf.usermodel.chart.AxisPosition;
+import org.apache.poi.xddf.usermodel.chart.ChartTypes;
+import org.apache.poi.xddf.usermodel.chart.LegendPosition;
+import org.apache.poi.xddf.usermodel.chart.XDDFCategoryAxis;
+import org.apache.poi.xddf.usermodel.chart.XDDFChartData;
+import org.apache.poi.xddf.usermodel.chart.XDDFChartLegend;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSource;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSourcesFactory;
+import org.apache.poi.xddf.usermodel.chart.XDDFNumericalDataSource;
+import org.apache.poi.xddf.usermodel.chart.XDDFValueAxis;
+import org.apache.poi.xssf.usermodel.XSSFChart;
+import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
+import org.apache.poi.xssf.usermodel.XSSFDrawing;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
@@ -44,8 +45,8 @@ import org.apache.poi.xssf.usermodel.XSS
public class LineChart {
public static void main(String[] args) throws IOException {
- try (Workbook wb = new XSSFWorkbook()) {
- Sheet sheet = wb.createSheet("linechart");
+ try (XSSFWorkbook wb = new XSSFWorkbook()) {
+ XSSFSheet sheet = wb.createSheet("linechart");
final int NUM_OF_ROWS = 3;
final int NUM_OF_COLUMNS = 10;
@@ -60,29 +61,26 @@ public class LineChart {
}
}
- Drawing<?> drawing = sheet.createDrawingPatriarch();
- ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 10,
15);
-
- Chart chart = drawing.createChart(anchor);
- ChartLegend legend = chart.getOrCreateLegend();
+ XSSFDrawing drawing = sheet.createDrawingPatriarch();
+ XSSFClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5,
10, 15);
+
+ XSSFChart chart = drawing.createChart(anchor);
+ XDDFChartLegend legend = chart.getOrAddLegend();
legend.setPosition(LegendPosition.TOP_RIGHT);
-
- LineChartData data =
chart.getChartDataFactory().createLineChartData();
-
+
// Use a category axis for the bottom axis.
- ChartAxis bottomAxis =
chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
- ValueAxis leftAxis =
chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);
+ XDDFCategoryAxis bottomAxis =
chart.createCategoryAxis(AxisPosition.BOTTOM);
+ XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);
-
- ChartDataSource<Number> xs =
DataSources.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0,
NUM_OF_COLUMNS - 1));
- ChartDataSource<Number> ys1 =
DataSources.fromNumericCellRange(sheet, new CellRangeAddress(1, 1, 0,
NUM_OF_COLUMNS - 1));
- ChartDataSource<Number> ys2 =
DataSources.fromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0,
NUM_OF_COLUMNS - 1));
-
-
+
+ XDDFDataSource<Double> xs =
XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(0, 0,
0, NUM_OF_COLUMNS - 1));
+ XDDFNumericalDataSource<Double> ys1 =
XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(1, 1,
0, NUM_OF_COLUMNS - 1));
+ XDDFNumericalDataSource<Double> ys2 =
XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(2, 2,
0, NUM_OF_COLUMNS - 1));
+
+ XDDFChartData data = chart.createData(ChartTypes.LINE, bottomAxis,
leftAxis);
data.addSeries(xs, ys1);
data.addSeries(xs, ys2);
-
- chart.plot(data, bottomAxis, leftAxis);
+ chart.plot(data);
// Write the output to a file
try (FileOutputStream fileOut = new
FileOutputStream("ooxml-line-chart.xlsx")) {
Modified:
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
---
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
(original)
+++
poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
Sun Nov 26 14:03:01 2017
@@ -23,21 +23,22 @@ import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Chart;
-import org.apache.poi.ss.usermodel.ClientAnchor;
-import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.usermodel.charts.AxisCrosses;
-import org.apache.poi.ss.usermodel.charts.AxisPosition;
-import org.apache.poi.ss.usermodel.charts.ChartDataSource;
-import org.apache.poi.ss.usermodel.charts.ChartLegend;
-import org.apache.poi.ss.usermodel.charts.DataSources;
-import org.apache.poi.ss.usermodel.charts.LegendPosition;
-import org.apache.poi.ss.usermodel.charts.ScatterChartData;
-import org.apache.poi.ss.usermodel.charts.ValueAxis;
import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xddf.usermodel.chart.AxisCrosses;
+import org.apache.poi.xddf.usermodel.chart.AxisPosition;
+import org.apache.poi.xddf.usermodel.chart.ChartTypes;
+import org.apache.poi.xddf.usermodel.chart.LegendPosition;
+import org.apache.poi.xddf.usermodel.chart.XDDFChartData;
+import org.apache.poi.xddf.usermodel.chart.XDDFChartLegend;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSource;
+import org.apache.poi.xddf.usermodel.chart.XDDFDataSourcesFactory;
+import org.apache.poi.xddf.usermodel.chart.XDDFNumericalDataSource;
+import org.apache.poi.xddf.usermodel.chart.XDDFValueAxis;
+import org.apache.poi.xssf.usermodel.XSSFChart;
+import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
+import org.apache.poi.xssf.usermodel.XSSFDrawing;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
@@ -46,8 +47,8 @@ import org.apache.poi.xssf.usermodel.XSS
public class ScatterChart {
public static void main(String[] args) throws IOException {
- try (Workbook wb = new XSSFWorkbook()) {
- Sheet sheet = wb.createSheet("Sheet 1");
+ try (XSSFWorkbook wb = new XSSFWorkbook()) {
+ XSSFSheet sheet = wb.createSheet("Sheet 1");
final int NUM_OF_ROWS = 3;
final int NUM_OF_COLUMNS = 10;
@@ -61,29 +62,28 @@ public class ScatterChart {
cell.setCellValue(colIndex * (rowIndex + 1));
}
}
-
- Drawing<?> drawing = sheet.createDrawingPatriarch();
- ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 10,
15);
-
- Chart chart = drawing.createChart(anchor);
- ChartLegend legend = chart.getOrCreateLegend();
+
+ XSSFDrawing drawing = sheet.createDrawingPatriarch();
+ XSSFClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5,
10, 15);
+
+ XSSFChart chart = drawing.createChart(anchor);
+ XDDFChartLegend legend = chart.getOrAddLegend();
legend.setPosition(LegendPosition.TOP_RIGHT);
-
- ScatterChartData data =
chart.getChartDataFactory().createScatterChartData();
-
- ValueAxis bottomAxis =
chart.getChartAxisFactory().createValueAxis(AxisPosition.BOTTOM);
- ValueAxis leftAxis =
chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);
+
+ XDDFValueAxis bottomAxis =
chart.createValueAxis(AxisPosition.BOTTOM);
+ XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);
-
- ChartDataSource<Number> xs =
DataSources.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0,
NUM_OF_COLUMNS - 1));
- ChartDataSource<Number> ys1 =
DataSources.fromNumericCellRange(sheet, new CellRangeAddress(1, 1, 0,
NUM_OF_COLUMNS - 1));
- ChartDataSource<Number> ys2 =
DataSources.fromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0,
NUM_OF_COLUMNS - 1));
-
-
- data.addSerie(xs, ys1);
- data.addSerie(xs, ys2);
-
- chart.plot(data, bottomAxis, leftAxis);
+
+ XDDFDataSource<Double> xs =
XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(0, 0,
0, NUM_OF_COLUMNS - 1));
+ XDDFNumericalDataSource<Double> ys1 =
XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(1, 1,
0, NUM_OF_COLUMNS - 1));
+ XDDFNumericalDataSource<Double> ys2 =
XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(2, 2,
0, NUM_OF_COLUMNS - 1));
+
+
+ XDDFChartData data = chart.createData(ChartTypes.SCATTER,
bottomAxis, leftAxis);
+
+ data.addSeries(xs, ys1);
+ data.addSeries(xs, ys2);
+ chart.plot(data);
// Write the output to a file
try (FileOutputStream fileOut = new
FileOutputStream("ooxml-scatter-chart.xlsx")) {
Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
(original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java Sun Nov
26 14:03:01 2017
@@ -45,13 +45,11 @@ import org.apache.poi.hssf.record.ObjRec
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.poifs.filesystem.DirectoryEntry;
import org.apache.poi.poifs.filesystem.DirectoryNode;
-import org.apache.poi.ss.usermodel.Chart;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.Internal;
-import org.apache.poi.util.NotImplemented;
import org.apache.poi.util.StringUtil;
/**
@@ -523,13 +521,6 @@ public final class HSSFPatriarch impleme
return new HSSFClientAnchor(dx1, dy1, dx2, dy2, (short) col1, row1,
(short) col2, row2);
}
- @Override
- @NotImplemented
- public Chart createChart(ClientAnchor anchor) {
- throw new RuntimeException("NotImplemented");
- }
-
-
/**
* create shape tree from existing escher records tree
*/
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Chart.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Chart.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Chart.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Chart.java Sun Nov 26
14:03:01 2017
@@ -19,20 +19,23 @@ package org.apache.poi.ss.usermodel;
import java.util.List;
-import org.apache.poi.ss.usermodel.charts.ChartData;
import org.apache.poi.ss.usermodel.charts.ChartAxis;
+import org.apache.poi.ss.usermodel.charts.ChartAxisFactory;
+import org.apache.poi.ss.usermodel.charts.ChartData;
+import org.apache.poi.ss.usermodel.charts.ChartDataFactory;
import org.apache.poi.ss.usermodel.charts.ChartLegend;
import org.apache.poi.ss.usermodel.charts.ManuallyPositionable;
-import org.apache.poi.ss.usermodel.charts.ChartDataFactory;
-import org.apache.poi.ss.usermodel.charts.ChartAxisFactory;
+import org.apache.poi.util.Removal;
/**
* High level representation of a chart.
*
- * @author Roman Kashitsyn
+ * @deprecated
*/
+@Deprecated
+@Removal(version="4.2")
public interface Chart extends ManuallyPositionable {
-
+
/**
* @return an appropriate ChartDataFactory implementation
*/
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Drawing.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Drawing.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Drawing.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Drawing.java Sun Nov 26
14:03:01 2017
@@ -40,14 +40,6 @@ public interface Drawing<T extends Shape
Comment createCellComment(ClientAnchor anchor);
/**
- * Creates a chart.
- * @param anchor the client anchor describes how this chart is attached
to
- * the sheet.
- * @return the newly created chart
- */
- Chart createChart(ClientAnchor anchor);
-
- /**
* Creates a new client anchor and sets the top-left and bottom-right
* coordinates of the anchor.
*
@@ -62,10 +54,10 @@ public interface Drawing<T extends Shape
* @return the newly created client anchor
*/
ClientAnchor createAnchor(int dx1, int dy1, int dx2, int dy2, int col1,
int row1, int col2, int row2);
-
+
/**
- * Adds a new OLE Package Shape
- *
+ * Adds a new OLE Package Shape
+ *
* @param anchor the client anchor describes how this picture is
* attached to the sheet.
* @param storageId the storageId returned by {@link
Workbook#addOlePackage(byte[], String, String, String)}
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrossBetween.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrossBetween.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrossBetween.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrossBetween.java
Sun Nov 26 14:03:01 2017
@@ -17,11 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Specifies the possible crossing states of an axis.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDF AxisCrossBetween
*/
+@Deprecated
+@Removal(version="4.2")
public enum AxisCrossBetween {
/**
* Specifies the value axis shall cross the category axis
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrosses.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrosses.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrosses.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisCrosses.java Sun
Nov 26 14:03:01 2017
@@ -17,11 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Specifies the possible crossing points for an axis.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDF AxisCrosses instead
*/
+@Deprecated
+@Removal(version="4.2")
public enum AxisCrosses {
/**
* The category axis crosses at the zero point of the value axis (if
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java
Sun Nov 26 14:03:01 2017
@@ -17,11 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Specifies the possible ways to place a picture on a data point, series,
wall, or floor.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDF AxisOrientation
*/
+@Deprecated
+@Removal(version="4.2")
public enum AxisOrientation {
/**
* Specifies that the values on the axis shall be reversed
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisPosition.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisPosition.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisPosition.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisPosition.java Sun
Nov 26 14:03:01 2017
@@ -17,11 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Enumeration of all possible axis positions.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDF AxisPosition instead
*/
+@Deprecated
+@Removal(version="4.2")
public enum AxisPosition {
BOTTOM,
LEFT,
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisTickMark.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisTickMark.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisTickMark.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisTickMark.java Sun
Nov 26 14:03:01 2017
@@ -17,11 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Enumeration of possible axis tick marks.
*
- * @author Martin Andersson
+ * @deprecated use XDDF AxisTickMark instead
*/
+@Deprecated
+@Removal(version="4.2")
public enum AxisTickMark {
NONE,
CROSS,
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxis.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxis.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxis.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxis.java Sun
Nov 26 14:03:01 2017
@@ -17,14 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* High level representation of chart axis.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDFChartAxis instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ChartAxis {
/**
@@ -153,7 +154,7 @@ public interface ChartAxis {
* @param tickMark minor tick mark type.
*/
void setMinorTickMark(AxisTickMark tickMark);
-
+
/**
* Use this to check before retrieving a number format, as calling {@link
#getNumberFormat()} may create a default one if none exists.
* @return true if a number format element is defined, false if not
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxisFactory.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxisFactory.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxisFactory.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartAxisFactory.java
Sun Nov 26 14:03:01 2017
@@ -17,31 +17,31 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* A factory for different chart axis.
*
- * @author Roman Kashitsyn
- * @author Martin Andersson
+ * @deprecated
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ChartAxisFactory {
/**
- * @param pos
+ * @param pos
* @return new value axis at the end of the list at the specified chart
position
*/
ValueAxis createValueAxis(AxisPosition pos);
/**
- * @param pos
+ * @param pos
* @return new category axis at the end of the list at the specified
chart position
*/
ChartAxis createCategoryAxis(AxisPosition pos);
-
+
/**
- * @param pos
+ * @param pos
* @return new date category axis at the end of the list at the
specified chart position
*/
ChartAxis createDateAxis(AxisPosition pos);
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartData.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartData.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartData.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartData.java Sun
Nov 26 14:03:01 2017
@@ -18,14 +18,15 @@
package org.apache.poi.ss.usermodel.charts;
import org.apache.poi.ss.usermodel.Chart;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* A base for all charts data types.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDFChartData instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ChartData {
/**
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataFactory.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataFactory.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataFactory.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataFactory.java
Sun Nov 26 14:03:01 2017
@@ -17,14 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* A factory for different charts data types.
*
- * @author Roman Kashitsyn, Martin Andersson
+ * @deprecated
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ChartDataFactory {
/**
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataSource.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataSource.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataSource.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartDataSource.java
Sun Nov 26 14:03:01 2017
@@ -18,15 +18,16 @@
*/
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* Represents data model of the charts.
*
* @param <T> type of points the data source contents
- * @author Roman Kashitsyn
+ * @deprecated use XDDFDataSource instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ChartDataSource<T> {
/**
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java Sun
Nov 26 14:03:01 2017
@@ -17,15 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* High level representation of chart legend.
*
- * @author Roman Kashitsyn
- * @author Martin Andersson
+ * @deprecated use XDDFChartLegend instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ChartLegend extends ManuallyPositionable {
/**
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java Sun
Nov 26 14:03:01 2017
@@ -18,10 +18,14 @@
package org.apache.poi.ss.usermodel.charts;
import org.apache.poi.ss.util.CellReference;
+import org.apache.poi.util.Removal;
/**
* Basic settings for all chart series.
+ * @deprecated
*/
+@Deprecated
+@Removal(version="4.2")
public interface ChartSeries {
/**
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java Sun
Nov 26 14:03:01 2017
@@ -19,16 +19,21 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.ss.usermodel.CellValue;
+import org.apache.poi.ss.usermodel.FormulaEvaluator;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* Class {@code DataSources} is a factory for {@link ChartDataSource}
instances.
*
- * @author Roman Kashitsyn
+ *@deprecated use XDDFDataSourcesFactory instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public class DataSources {
private DataSources() {
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutMode.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutMode.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutMode.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutMode.java Sun
Nov 26 14:03:01 2017
@@ -17,10 +17,14 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Specifies the possible ways to store a chart element's position.
- * @author Roman Kashitsyn
+ * @use XDDF LayoutMode instead
*/
+@Deprecated
+@Removal(version="4.2")
public enum LayoutMode {
/**
* Specifies that the Width or Height shall be interpreted as the
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutTarget.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutTarget.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutTarget.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LayoutTarget.java Sun
Nov 26 14:03:01 2017
@@ -17,12 +17,16 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Specifies whether to layout the plot area by its inside (not including axis
* and axis labels) or outside (including axis and axis labels).
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDF LayoutTarget instead
*/
+@Deprecated
+@Removal(version="4.2")
public enum LayoutTarget {
/**
* Specifies that the plot area size shall determine the
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LegendPosition.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LegendPosition.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LegendPosition.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LegendPosition.java
Sun Nov 26 14:03:01 2017
@@ -17,11 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Enumeration of all possible chart legend positions.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDF LayoutPosition instead
*/
+@Deprecated
+@Removal(version="4.2")
public enum LegendPosition {
BOTTOM,
LEFT,
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java
Sun Nov 26 14:03:01 2017
@@ -19,12 +19,15 @@ package org.apache.poi.ss.usermodel.char
import java.util.List;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* Data for a Line Chart
+ *
+ * @deprecated use XDDFLineChartData instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface LineChartData extends ChartData {
/**
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java
Sun Nov 26 14:03:01 2017
@@ -17,12 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* Represents a line chart series.
+ *
+ * @deprecated use XDDFLineChartData.Series instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface LineChartSeries extends ChartSeries {
/**
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManualLayout.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManualLayout.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManualLayout.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManualLayout.java Sun
Nov 26 14:03:01 2017
@@ -17,14 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* High level representation of chart element manual layout.
*
- * @author Roman Kashitsyn
+ * @deprecated use XDDFManualLayout instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ManualLayout {
/**
@@ -117,7 +118,7 @@ public interface ManualLayout {
public void setHeightMode(LayoutMode mode);
/**
- * Returns current height mode of this
+ * Returns current height mode of this
* @return height mode of this manual layout.
*/
public LayoutMode getHeightMode();
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManuallyPositionable.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManuallyPositionable.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
---
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManuallyPositionable.java
(original)
+++
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ManuallyPositionable.java
Sun Nov 26 14:03:01 2017
@@ -17,15 +17,16 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* Abstraction of chart element that can be positioned with manual
* layout.
*
- * @author Roman Kashitsyn
+ * @deprecated
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ManuallyPositionable {
/**
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java
Sun Nov 26 14:03:01 2017
@@ -19,9 +19,15 @@ package org.apache.poi.ss.usermodel.char
import java.util.List;
+import org.apache.poi.util.Removal;
+
/**
* Data for a Scatter Chart
+ *
+ * @deprecated use XDDFScatterChartData instead
*/
+@Deprecated
+@Removal(version="4.2")
public interface ScatterChartData extends ChartData {
/**
* @param xs data source to be used for X axis values
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
---
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java
(original)
+++
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java
Sun Nov 26 14:03:01 2017
@@ -17,12 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
* Represents scatter charts series.
+ *
+ * @deprecated use XDFFScatterChartData.Series instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ScatterChartSeries extends ChartSeries {
/**
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java Sun
Nov 26 14:03:01 2017
@@ -17,11 +17,15 @@
package org.apache.poi.ss.usermodel.charts;
+import org.apache.poi.util.Removal;
+
/**
* Title types for charts.
*
- * @author Martin Andersson
+ * @deprecated
*/
+@Deprecated
+@Removal(version="4.2")
public enum TitleType {
STRING,
CELL_REFERENCE
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ValueAxis.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ValueAxis.java?rev=1816383&r1=1816382&r2=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ValueAxis.java
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ValueAxis.java Sun
Nov 26 14:03:01 2017
@@ -17,12 +17,13 @@
package org.apache.poi.ss.usermodel.charts;
-import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
/**
- * @author Roman Kashitsyn
+ * @deprecated use XDDFValueAxis instead
*/
-@Beta
+@Deprecated
+@Removal(version="4.2")
public interface ValueAxis extends ChartAxis {
/**
Added:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrossBetween.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrossBetween.java?rev=1816383&view=auto
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrossBetween.java
(added)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrossBetween.java
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,44 @@
+/* ====================================================================
+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 java.util.HashMap;
+
+import org.openxmlformats.schemas.drawingml.x2006.chart.STCrossBetween;
+
+public enum AxisCrossBetween {
+ BETWEEN(STCrossBetween.BETWEEN),
+ MIDPOINT_CATEGORY(STCrossBetween.MID_CAT);
+
+ final STCrossBetween.Enum underlying;
+
+ AxisCrossBetween(STCrossBetween.Enum crossBetween) {
+ this.underlying = crossBetween;
+ }
+
+ private final static HashMap<STCrossBetween.Enum, AxisCrossBetween>
reverse = new HashMap<STCrossBetween.Enum, AxisCrossBetween>();
+ static {
+ for (AxisCrossBetween value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static AxisCrossBetween valueOf(STCrossBetween.Enum crossBetween) {
+ return reverse.get(crossBetween);
+ }
+}
Added:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrosses.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrosses.java?rev=1816383&view=auto
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrosses.java
(added)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisCrosses.java
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,45 @@
+/* ====================================================================
+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 java.util.HashMap;
+
+import org.openxmlformats.schemas.drawingml.x2006.chart.STCrosses;
+
+public enum AxisCrosses {
+ AUTO_ZERO(STCrosses.AUTO_ZERO),
+ MAX(STCrosses.MAX),
+ MIN(STCrosses.MIN);
+
+ final STCrosses.Enum underlying;
+
+ AxisCrosses(STCrosses.Enum crosses) {
+ this.underlying = crosses;
+ }
+
+ private final static HashMap<STCrosses.Enum, AxisCrosses> reverse = new
HashMap<STCrosses.Enum, AxisCrosses>();
+ static {
+ for (AxisCrosses value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static AxisCrosses valueOf(STCrosses.Enum crosses) {
+ return reverse.get(crosses);
+ }
+}
Added:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisLabelAlignment.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisLabelAlignment.java?rev=1816383&view=auto
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisLabelAlignment.java
(added)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisLabelAlignment.java
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,45 @@
+/* ====================================================================
+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 java.util.HashMap;
+
+import org.openxmlformats.schemas.drawingml.x2006.chart.STLblAlgn;
+
+public enum AxisLabelAlignment {
+ CENTER(STLblAlgn.CTR),
+ LEFT(STLblAlgn.L),
+ RIGHT(STLblAlgn.R);
+
+ final STLblAlgn.Enum underlying;
+
+ AxisLabelAlignment(STLblAlgn.Enum alignment) {
+ this.underlying = alignment;
+ }
+
+ private final static HashMap<STLblAlgn.Enum, AxisLabelAlignment> reverse =
new HashMap<STLblAlgn.Enum, AxisLabelAlignment>();
+ static {
+ for (AxisLabelAlignment value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static AxisLabelAlignment valueOf(STLblAlgn.Enum alignment) {
+ return reverse.get(alignment);
+ }
+}
Copied:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisOrientation.java
(from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java)
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisOrientation.java?p2=poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisOrientation.java&p1=poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java&r1=1816205&r2=1816383&rev=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/AxisOrientation.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisOrientation.java
Sun Nov 26 14:03:01 2017
@@ -15,22 +15,30 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.ss.usermodel.charts;
+package org.apache.poi.xddf.usermodel.chart;
+
+import java.util.HashMap;
+
+import org.openxmlformats.schemas.drawingml.x2006.chart.STOrientation;
-/**
- * Specifies the possible ways to place a picture on a data point, series,
wall, or floor.
- *
- * @author Roman Kashitsyn
- */
public enum AxisOrientation {
- /**
- * Specifies that the values on the axis shall be reversed
- * so they go from maximum to minimum.
- */
- MAX_MIN,
- /**
- * Specifies that the axis values shall be in the usual
- * order, minimum to maximum.
- */
- MIN_MAX
+ MIN_MAX(STOrientation.MIN_MAX),
+ MAX_MIN(STOrientation.MAX_MIN);
+
+ final STOrientation.Enum underlying;
+
+ AxisOrientation(STOrientation.Enum orientation) {
+ this.underlying = orientation;
+ }
+
+ private final static HashMap<STOrientation.Enum, AxisOrientation> reverse
= new HashMap<STOrientation.Enum, AxisOrientation>();
+ static {
+ for (AxisOrientation value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static AxisOrientation valueOf(STOrientation.Enum orientation) {
+ return reverse.get(orientation);
+ }
}
Added:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisPosition.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisPosition.java?rev=1816383&view=auto
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisPosition.java
(added)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisPosition.java
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,46 @@
+/* ====================================================================
+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 java.util.HashMap;
+
+import org.openxmlformats.schemas.drawingml.x2006.chart.STAxPos;
+
+public enum AxisPosition {
+ BOTTOM(STAxPos.B),
+ LEFT(STAxPos.L),
+ RIGHT(STAxPos.R),
+ TOP(STAxPos.T);
+
+ final STAxPos.Enum underlying;
+
+ AxisPosition(STAxPos.Enum position) {
+ this.underlying = position;
+ }
+
+ private final static HashMap<STAxPos.Enum, AxisPosition> reverse = new
HashMap<STAxPos.Enum, AxisPosition>();
+ static {
+ for (AxisPosition value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static AxisPosition valueOf(STAxPos.Enum position) {
+ return reverse.get(position);
+ }
+}
Added:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickLabelPosition.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickLabelPosition.java?rev=1816383&view=auto
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickLabelPosition.java
(added)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickLabelPosition.java
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,46 @@
+/* ====================================================================
+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 java.util.HashMap;
+
+import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos;
+
+public enum AxisTickLabelPosition {
+ HIGH(STTickLblPos.HIGH),
+ LOW(STTickLblPos.LOW),
+ NEXT_TO(STTickLblPos.NEXT_TO),
+ NONE(STTickLblPos.NONE);
+
+ final STTickLblPos.Enum underlying;
+
+ AxisTickLabelPosition(STTickLblPos.Enum position) {
+ this.underlying = position;
+ }
+
+ private final static HashMap<STTickLblPos.Enum, AxisTickLabelPosition>
reverse = new HashMap<STTickLblPos.Enum, AxisTickLabelPosition>();
+ static {
+ for (AxisTickLabelPosition value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static AxisTickLabelPosition valueOf(STTickLblPos.Enum position) {
+ return reverse.get(position);
+ }
+}
Added:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickMark.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickMark.java?rev=1816383&view=auto
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickMark.java
(added)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/AxisTickMark.java
Sun Nov 26 14:03:01 2017
@@ -0,0 +1,46 @@
+/* ====================================================================
+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 java.util.HashMap;
+
+import org.openxmlformats.schemas.drawingml.x2006.chart.STTickMark;
+
+public enum AxisTickMark {
+ CROSS(STTickMark.CROSS),
+ IN(STTickMark.IN),
+ NONE(STTickMark.NONE),
+ OUT(STTickMark.OUT);
+
+ final STTickMark.Enum underlying;
+
+ AxisTickMark(STTickMark.Enum tickMark) {
+ this.underlying = tickMark;
+ }
+
+ private final static HashMap<STTickMark.Enum, AxisTickMark> reverse = new
HashMap<STTickMark.Enum, AxisTickMark>();
+ static {
+ for (AxisTickMark value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static AxisTickMark valueOf(STTickMark.Enum tickMark) {
+ return reverse.get(tickMark);
+ }
+}
Copied:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarDirection.java
(from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java)
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarDirection.java?p2=poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarDirection.java&p1=poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java&r1=1816205&r2=1816383&rev=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartLegend.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarDirection.java
Sun Nov 26 14:03:01 2017
@@ -15,41 +15,30 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.ss.usermodel.charts;
+package org.apache.poi.xddf.usermodel.chart;
-import org.apache.poi.util.Beta;
+import java.util.HashMap;
-/**
- * High level representation of chart legend.
- *
- * @author Roman Kashitsyn
- * @author Martin Andersson
- */
-@Beta
-public interface ChartLegend extends ManuallyPositionable {
-
- /**
- * @return legend position
- */
- LegendPosition getPosition();
-
- /**
- * @param position new legend position
- */
- void setPosition(LegendPosition position);
-
- /**
- * @return overlay value.
- */
- boolean isOverlay();
-
- /**
- * If true the legend is positioned over the chart area otherwise
- * the legend is displayed next to it.
- *
- * Default is no overlay.
- *
- * @param value
- */
- void setOverlay(boolean value);
+import org.openxmlformats.schemas.drawingml.x2006.chart.STBarDir;
+
+public enum BarDirection {
+ BAR(STBarDir.BAR),
+ COL(STBarDir.COL);
+
+ final STBarDir.Enum underlying;
+
+ BarDirection(STBarDir.Enum direction) {
+ this.underlying = direction;
+ }
+
+ private final static HashMap<STBarDir.Enum, BarDirection> reverse = new
HashMap<STBarDir.Enum, BarDirection>();
+ static {
+ for (BarDirection value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static BarDirection valueOf(STBarDir.Enum direction) {
+ return reverse.get(direction);
+ }
}
Copied:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarGrouping.java
(from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java)
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarGrouping.java?p2=poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarGrouping.java&p1=poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java&r1=1816205&r2=1816383&rev=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/BarGrouping.java
Sun Nov 26 14:03:01 2017
@@ -15,41 +15,32 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.ss.usermodel.charts;
+package org.apache.poi.xddf.usermodel.chart;
-import org.apache.poi.ss.util.CellReference;
+import java.util.HashMap;
-/**
- * Basic settings for all chart series.
- */
-public interface ChartSeries {
-
- /**
- * Sets the title of the series as a string literal.
- *
- * @param title
- */
- void setTitle(String title);
-
- /**
- * Sets the title of the series as a cell reference.
- *
- * @param titleReference
- */
- void setTitle(CellReference titleReference);
-
- /**
- * @return title as string literal.
- */
- String getTitleString();
-
- /**
- * @return title as cell reference.
- */
- CellReference getTitleCellReference();
-
- /**
- * @return title type.
- */
- TitleType getTitleType();
+import org.openxmlformats.schemas.drawingml.x2006.chart.STBarGrouping;
+
+public enum BarGrouping {
+ STANDARD(STBarGrouping.STANDARD),
+ CLUSTERED(STBarGrouping.CLUSTERED),
+ STACKED(STBarGrouping.STACKED),
+ PERCENT_STACKED(STBarGrouping.PERCENT_STACKED);
+
+ final STBarGrouping.Enum underlying;
+
+ BarGrouping(STBarGrouping.Enum grouping) {
+ this.underlying = grouping;
+ }
+
+ private final static HashMap<STBarGrouping.Enum, BarGrouping> reverse =
new HashMap<STBarGrouping.Enum, BarGrouping>();
+ static {
+ for (BarGrouping value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static BarGrouping valueOf(STBarGrouping.Enum grouping) {
+ return reverse.get(grouping);
+ }
}
Copied:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/ChartTypes.java
(from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java)
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/ChartTypes.java?p2=poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/ChartTypes.java&p1=poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java&r1=1816205&r2=1816383&rev=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/TitleType.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/ChartTypes.java
Sun Nov 26 14:03:01 2017
@@ -14,15 +14,12 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+package org.apache.poi.xddf.usermodel.chart;
-package org.apache.poi.ss.usermodel.charts;
-
-/**
- * Title types for charts.
- *
- * @author Martin Andersson
- */
-public enum TitleType {
- STRING,
- CELL_REFERENCE
+public enum ChartTypes {
+ BAR,
+ LINE,
+ PIE,
+ RADAR,
+ SCATTER;
}
Copied:
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/Grouping.java
(from r1816205,
poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java)
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/Grouping.java?p2=poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/Grouping.java&p1=poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java&r1=1816205&r2=1816383&rev=1816383&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/Grouping.java
Sun Nov 26 14:03:01 2017
@@ -15,41 +15,31 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.ss.usermodel.charts;
+package org.apache.poi.xddf.usermodel.chart;
-import org.apache.poi.ss.util.CellReference;
+import java.util.HashMap;
-/**
- * Basic settings for all chart series.
- */
-public interface ChartSeries {
-
- /**
- * Sets the title of the series as a string literal.
- *
- * @param title
- */
- void setTitle(String title);
-
- /**
- * Sets the title of the series as a cell reference.
- *
- * @param titleReference
- */
- void setTitle(CellReference titleReference);
-
- /**
- * @return title as string literal.
- */
- String getTitleString();
-
- /**
- * @return title as cell reference.
- */
- CellReference getTitleCellReference();
-
- /**
- * @return title type.
- */
- TitleType getTitleType();
+import org.openxmlformats.schemas.drawingml.x2006.chart.STGrouping;
+
+public enum Grouping {
+ STANDARD(STGrouping.STANDARD),
+ STACKED(STGrouping.STACKED),
+ PERCENT_STACKED(STGrouping.PERCENT_STACKED);
+
+ final STGrouping.Enum underlying;
+
+ Grouping(STGrouping.Enum grouping) {
+ this.underlying = grouping;
+ }
+
+ private final static HashMap<STGrouping.Enum, Grouping> reverse = new
HashMap<STGrouping.Enum, Grouping>();
+ static {
+ for (Grouping value : values()) {
+ reverse.put(value.underlying, value);
+ }
+ }
+
+ static Grouping valueOf(STGrouping.Enum grouping) {
+ return reverse.get(grouping);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]