aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorAlain Béarez <abearez@apache.org>2018-10-05 09:59:32 +0000
committerAlain Béarez <abearez@apache.org>2018-10-05 09:59:32 +0000
commitf446df6f6647e765970e5074b8429856cf5cbffe (patch)
tree2cd42df025e68cc693f5e2ad4b83064d3f02f718 /src/examples
parent621de405a6efbd792b23c57ae5b3fd602513f6f1 (diff)
downloadpoi-f446df6f6647e765970e5074b8429856cf5cbffe.tar.gz
poi-f446df6f6647e765970e5074b8429856cf5cbffe.zip
more XDDF improvements based on SO examples
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842876 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java2
-rw-r--r--src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java2
-rw-r--r--src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java2
-rw-r--r--src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java2
-rw-r--r--src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java2
5 files changed, 10 insertions, 0 deletions
diff --git a/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java b/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
index bd26f8c731..3b96eb0bda 100644
--- a/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
+++ b/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
@@ -115,6 +115,8 @@ public class BarChartDemo {
series2.setTitle(series[1], chart.setSheetTitle(series[1], 1));
chart.plot(bar);
+ chart.setTitleText(chartTitle); // https://stackoverflow.com/questions/30532612
+ // chart.setTitleOverlay(overlay);
}
private static void setColumnData(XSLFChart chart, String chartTitle) {
diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java
index c9e73efaba..3e58b912e8 100644
--- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java
+++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java
@@ -76,7 +76,9 @@ public class BarChart {
// Use a category axis for the bottom axis.
XDDFCategoryAxis bottomAxis = chart.createCategoryAxis(AxisPosition.BOTTOM);
+ bottomAxis.setTitle("x"); // https://stackoverflow.com/questions/32010765
XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
+ leftAxis.setTitle("f(x)");
leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);
XDDFDataSource<Double> xs = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
index 9a48f4757a..9d56656795 100644
--- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
+++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
@@ -77,7 +77,9 @@ public class LineChart {
// Use a category axis for the bottom axis.
XDDFCategoryAxis bottomAxis = chart.createCategoryAxis(AxisPosition.BOTTOM);
+ bottomAxis.setTitle("x"); // https://stackoverflow.com/questions/32010765
XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
+ leftAxis.setTitle("f(x)");
leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);
XDDFDataSource<Double> xs = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
index 8c62436e5a..2cd818a36b 100644
--- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
+++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
@@ -77,7 +77,9 @@ public class ScatterChart {
legend.setPosition(LegendPosition.TOP_RIGHT);
XDDFValueAxis bottomAxis = chart.createValueAxis(AxisPosition.BOTTOM);
+ bottomAxis.setTitle("x"); // https://stackoverflow.com/questions/32010765
XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
+ leftAxis.setTitle("f(x)");
leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);
XDDFDataSource<Double> xs = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
diff --git a/src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java b/src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java
index 55185cbf81..9950ffebd7 100644
--- a/src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java
+++ b/src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java
@@ -117,6 +117,8 @@ public class BarChartExample {
series2.setTitle(series[1], chart.setSheetTitle(series[1], 1));
chart.plot(bar);
+ chart.setTitleText(chartTitle); // https://stackoverflow.com/questions/30532612
+ // chart.setTitleOverlay(overlay);
}
private static void setColumnData(XWPFChart chart, String chartTitle) {