Browse our Products

Aspose.Slides for Java 25.9 Release Notes

KeySummaryCategoryRelated Documentation
SLIDESNET-45084Missing X, Y, Width, and Height values for chart elementsEnhancementhttps://docs.aspose.com/slides/net/chart-calculations/
SLIDESNET-45082Improve import of extended Excel chartsEnhancement
SLIDESJAVA-39575Use Aspose.Slides for Net 25.9 featuresEnhancement
SLIDESJAVA-39696JPMorgan logo missing and label text broken in PDF outputBughttps://docs.aspose.com/slides/java/convert-powerpoint-to-pdf/
SLIDESJAVA-39701Chart legend label values change when converting PPTX to PDFBughttps://docs.aspose.com/slides/java/convert-powerpoint-to-pdf/
SLIDESJAVA-39712wk : Chart legend items wrong order after saving to imageBughttps://docs.aspose.com/slides/java/convert-powerpoint-to-png/

Public API Changes

Updated Classes: ChartTitle and Legend

The ChartTitle and Legend classes now implement the IActualLayout interface.
This provides access to the following properties: ActualX, ActualY, ActualWidth, and ActualHeight.

/**
 * <p>
 * Specifies actual x location (left) of the chart element relative to the left top corner of the chart.
 * Call method IChart.validateChartLayout() before to get actual values.
 * Read float.
 * </p>
 */
public final float getActualX()

/**
 * <p>
 * Specifies actual top of the chart element relative to the left top corner of the chart.
 * Call method IChart.validateChartLayout() before to get actual values.
 * Read float.
 * </p>
 */
public final float getActualY()

/**
 * <p>
 * Specifies actual width of the chart element. Call method IChart.validateChartLayout() before to get actual values.
 * Read float.
 * </p>
 */
public final float getActualWidth()

/**
 * <p>
 * Specifies actual height of the chart element. Call method IChart.validateChartLayout() before to get actual values.
 * Read float.
 * </p>
 */
public final float getActualHeight()

The following code sample demonstrates how to use these properties:

Presentation pres = new Presentation();
try {
    IChart chart = (Chart)pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350);
    chart.validateChartLayout();

    IChartTitle chartTitle = chart.getChartTitle();
    System.out.println("ChartTitle.X = " + chartTitle.getActualX() + ", ChartTitle.Y = " + chartTitle.getActualY());
    System.out.println("ChartTitle.Width = " + chartTitle.getActualWidth() + ", ChartTitle.Height = " + chartTitle.getActualHeight());

    ILegend legend = chart.getLegend();
    System.out.println("Legend.X = " + legend.getActualX() + ", Legend.Y = " + legend.getActualY());
    System.out.println("Legend.Width = " + legend.getActualWidth() + ", Legend.Height = " + legend.getActualHeight());
} finally {
    if (pres != null) pres.dispose();
}