Chart legends - custom position

Version: 14.9.0


I have been attempting to position the legend in the top left corner. Here is the code:

public static void main(String[] args) {
final Presentation pres = new Presentation();
final IChart c = pres.getSlides()
.get_Item(0)
.getShapes()
.addChart(
ChartType.ClusteredColumn,
0, 0, 500, 500);
final ILegend legend = c.getLegend();
legend.setPosition(LegendPositionType.Left);
// Want to move to top left
legend.setX(0);
legend.setY(0);
System.out.println(String.format(
“x=%f, y=%f, w=%f, h=%f”,
legend.getX(),
legend.getY(),
legend.getWidth(),
legend.getHeight()));
pres.save(“D:/test.pptx”, SaveFormat.Pptx);
}

The console out put is:

x=0.000000, y=0.000000, w=NaN, h=NaN

The legend does not move. Any advice?

Result of code is attached.

Hi Shaun,


I have observed the requirement shared and like to share that at present Aspose.Slides offers to set the position by using predetermined positions in enumerators. The custom size and position for legends is unavailable in Aspose.Slides. I have created an issue with ID SLIDESJAVA-34642 in our issue tracking system to further investigate the possibility of implementing the requested support. This thread has been linked with the issue so that you may be automatically notified once the support will be available.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-34642) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.