I’m trying to add a custom shape to the chart. Code:
public static void main(String[] args) throws Exception {
final Presentation pres = new Presentation();
final IChart c = pres.getSlides()
.get_Item(0)
.getShapes()
.addChart(
ChartType.ClusteredColumn,
0, 0, 720, 540);
final IAutoShape shape =
c.getUserShapes()
.getShapes()
.addAutoShape(
ShapeType.Rectangle,
0, 0, 100, 100);
shape.getTextFrame().setText(“Hello World”);
pres.save(“D:/test.pptx”, SaveFormat.Pptx);
Desktop.getDesktop().open(new File(“D:/test.pptx”));
}
This does not produce a rectangle with text in it that I can see. I looked at the docs and examples but couldn’t see anything for user shapes in charts. Appreciate any advice you have.
Output file attached.