Hi,
I am using Aspose Slides Java and I try to get the automatically determined value for the major unit of the vertical axis. However, as long as I do not provide a value manually, the method getActualMajorUnit
simply returns zero.
I use the sample code below, which is mostly the same as given in Chart Axis|Aspose.Slides Documentation, except that I also read out the major and minor units for the vertical axis.
When I execute it, Aspose Slides returns zero for the axis major/minor unit values, but when I open the generated presentation with PowerPoint, it shows 1.0 for the vertical axis major unit and 0.2 for the minor unit.
Is my expectation wrong that Aspose Slides returns the same values (or similar ones) for the major/minor unit than PowerPoint does?
Aspose.Slides versions: 25.4, 25.5
Kotlin code snippet:
val pres = Presentation()
try {
val chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Area, 100f, 100f, 500f, 350f)
chart.validateChartLayout()
val maxValue = chart.getAxes().getVerticalAxis().getActualMaxValue();
val minValue = chart.getAxes().getVerticalAxis().getActualMinValue();
val majorUnitV = chart.getAxes().getVerticalAxis().getActualMajorUnit();
val minorUnitV = chart.getAxes().getVerticalAxis().getActualMinorUnit();
val majorUnitH = chart.getAxes().getHorizontalAxis().getActualMajorUnit();
val minorUnitH = chart.getAxes().getHorizontalAxis().getActualMinorUnit();
// Saves the presentation
pres.save("MaxValuesVerticalAxis_out.pptx", SaveFormat.Pptx);
} finally {
pres.dispose();
}
Regards,
Markus