temp workaround for chart axis issue

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913671 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2023-11-08 11:14:47 +00:00
parent e83987b35d
commit 726fa5c85e
5 changed files with 20 additions and 0 deletions

View File

@ -180,6 +180,10 @@ public final class ChartFromScratch {
chart.setTitleText(chartTitle); chart.setTitleText(chartTitle);
chart.setTitleOverlay(false); chart.setTitleOverlay(false);
chart.setAutoTitleDeleted(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; private static final int COLUMN_LANGUAGES = 0;

View File

@ -104,6 +104,10 @@ public final class BarChart {
solidFillSeries(data, 0, PresetColor.CHARTREUSE); solidFillSeries(data, 0, PresetColor.CHARTREUSE);
solidFillSeries(data, 1, PresetColor.TURQUOISE); 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 // Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("ooxml-bar-chart.xlsx")) { try (FileOutputStream fileOut = new FileOutputStream("ooxml-bar-chart.xlsx")) {
wb.write(fileOut); wb.write(fileOut);

View File

@ -105,6 +105,10 @@ public final class LineChart {
solidLineSeries(data, 0, PresetColor.CHARTREUSE); solidLineSeries(data, 0, PresetColor.CHARTREUSE);
solidLineSeries(data, 1, PresetColor.TURQUOISE); 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 // Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("ooxml-line-chart.xlsx")) { try (FileOutputStream fileOut = new FileOutputStream("ooxml-line-chart.xlsx")) {
wb.write(fileOut); wb.write(fileOut);

View File

@ -99,6 +99,10 @@ public final class ScatterChart {
solidLineSeries(data, 0, PresetColor.CHARTREUSE); solidLineSeries(data, 0, PresetColor.CHARTREUSE);
solidLineSeries(data, 1, PresetColor.TURQUOISE); 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 // Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("ooxml-scatter-chart.xlsx")) { try (FileOutputStream fileOut = new FileOutputStream("ooxml-scatter-chart.xlsx")) {
wb.write(fileOut); wb.write(fileOut);

View File

@ -146,6 +146,10 @@ public final class ChartFromScratch {
chart.setTitleText(chartTitle); chart.setTitleText(chartTitle);
chart.setTitleOverlay(false); chart.setTitleOverlay(false);
chart.setAutoTitleDeleted(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; private static final int COLUMN_LANGUAGES = 0;