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.