There seem to be an issue with the color of some labels in the Bar Chart when font color is set to “Automatic”.
If you inspect the right-most chart (cells $W$4 through $AF$16), you will notice that the first bar (with value “8259”) has white font color,
whereas the right-most bar in the chart (with the value “8350”) has a black font color.
When this worksheet is read with Aspose, the font color for the first bar (with the white label) is ignored,
and Aspose applies the style of the last bar (which is a black font color).
For comparison purpose there is also another chart ($K$3 through $S$16) where both the first and the last bar have white font color.
For that chart the resulting worksheet shows the data labels with correct color.
This issue is easily reproducible with the attached worksheet and the following test java code:
static final String xlFile = PATH + "BarChart_WhiteAndBlackLabels.xlsx";
static final String xlFileOutput = PATH + "BarChart_WhiteAndBlackLabels_output.xlsx";
try {
// Load the Excel file from the file system
FileInputStream fileInputStream = new FileInputStream(xlFile);
Workbook workbook = new Workbook(fileInputStream);
// Save the workbook to a new file
FileOutputStream fileOutputStream = new FileOutputStream(xlFileOutput);
workbook.save(fileOutputStream, SaveFormat.XLSX);
// Close the file streams
fileInputStream.close();
fileOutputStream.close();
System.out.println("Excel file has been read and written successfully.");
} catch (Exception ex) {
throw new IllegalStateException(ex.getMessage(), ex);
}
Attached archive BarChart_WhiteAndBlackLabels.zip contains input workbook BarChart_WhiteAndBlackLabels.xlsx and output BarChart_WhiteAndBlackLabels_output_24_8.xlsx illustrating this issue.
If you have any suggestion/workaround, please let us know.
Thank you.
BarChart_WhiteAndBlackLabels.zip (37.7 KB)