Aspose.Slides for Java: Chart's Vertical Axis: Actual Major Unit Returns 0

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

@Mrks9947,
Thank you for contacting free support. We are sorry that you encountered this problem. I need some time to check the issue. I will get back to you as soon as possible.

@Mrks9947,
Thank you for your patience. I’ve reproduced the issue when reading the chart properties you described.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39674

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like