diff options
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; |