When displaying values in a mixed type chart (two vertical bars as whole numbers against the left y-axis, a line as a percentage against the right y-axis), the data labels display correctly, but the number formats for the axes don’t…despite debug statements that would seem to indicate they’re correct.
For this snippet -
// there’s one chart on this slide, a series of mixed types
if (shape instanceof IChart) {
IChart chart = (IChart) shape;
IAxesManager axes = chart.getAxes();
IAxis yaxis1 = axes.getVerticalAxis();
logger.debug("Number format axis 1 is " + yaxis1.getNumberFormat());
IAxis yaxis2 = axes.getSecondaryVerticalAxis();
logger.debug("Number format axis 2 is " + yaxis2.getNumberFormat());
…}
the output is
Number format axis 1 is #,##0
Number format axis 2 is 0.00%
…which is acceptable, but numbers on the left axis are showing up as 10000,20000,etc instead of 10,000, 20,000, etc., and the right axis are 0.1, 0.2, etc instead of 10% 20%, even after following the above statements with:
yaxis1.setNumberFormat("#,##0");
yaxis2.setMaxValue(1.0);
yaxis2.setNumberFormat("%,.2f%%");
…which seem to have no effect. I cannot find any examples relating to slides for java 19.12, all the questions answered that are similar seem to be for the .NET version.
I mean, it’s easy enough to workaround in PowerPoint manually, but it would be nice to not ask the eventual user of the slides output to have to do this a dozen times for each run?