aboutsummaryrefslogtreecommitdiffstats
path: root/poi-examples
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-11-08 11:14:47 +0000
committerPJ Fanning <fanningpj@apache.org>2023-11-08 11:14:47 +0000
commit726fa5c85e595d871bc78743a663b04f85bb7860 (patch)
tree4886321255ac2233d649f149b4a703ec8f37e663 /poi-examples
parente83987b35db793657e39db1f7e5d1f256efa52bf (diff)
downloadpoi-726fa5c85e595d871bc78743a663b04f85bb7860.tar.gz
poi-726fa5c85e595d871bc78743a663b04f85bb7860.zip
temp workaround for chart axis issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913671 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-examples')
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java4
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BarChart.java4
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/LineChart.java4
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/ScatterChart.java4
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java4
5 files changed, 20 insertions, 0 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java b/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java
index 121b642a0c..83967307a3 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xslf/ChartFromScratch.java
@@ -180,6 +180,10 @@ public final class ChartFromScratch {
chart.setTitleText(chartTitle);
chart.setTitleOverlay(false);
chart.setAutoTitleDeleted(false);
+
+ // temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
+ if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
+ if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
}
private static final int COLUMN_LANGUAGES = 0;
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BarChart.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BarChart.java
index 7f1f1c5ec6..76dbf67f19 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BarChart.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BarChart.java
@@ -104,6 +104,10 @@ public final class BarChart {
solidFillSeries(data, 0, PresetColor.CHARTREUSE);
solidFillSeries(data, 1, PresetColor.TURQUOISE);
+ // temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
+ if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
+ if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
+
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("ooxml-bar-chart.xlsx")) {
wb.write(fileOut);
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/LineChart.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/LineChart.java
index d0cf568e6a..32948c694c 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/LineChart.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/LineChart.java
@@ -105,6 +105,10 @@ public final class LineChart {
solidLineSeries(data, 0, PresetColor.CHARTREUSE);
solidLineSeries(data, 1, PresetColor.TURQUOISE);
+ // temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
+ if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
+ if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
+
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("ooxml-line-chart.xlsx")) {
wb.write(fileOut);
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/ScatterChart.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/ScatterChart.java
index c74de7f840..47daa07084 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/ScatterChart.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/ScatterChart.java
@@ -99,6 +99,10 @@ public final class ScatterChart {
solidLineSeries(data, 0, PresetColor.CHARTREUSE);
solidLineSeries(data, 1, PresetColor.TURQUOISE);
+ // temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
+ if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
+ if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
+
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("ooxml-scatter-chart.xlsx")) {
wb.write(fileOut);
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
index 0625204699..6a346aa97b 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
@@ -146,6 +146,10 @@ public final class ChartFromScratch {
chart.setTitleText(chartTitle);
chart.setTitleOverlay(false);
chart.setAutoTitleDeleted(false);
+
+ // temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
+ if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
+ if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
}
private static final int COLUMN_LANGUAGES = 0;