I am trying to create PowerPoint presentations with python-pptx and currently I am trying to create shapes and connectors in a for loop. Even though the Connector is created and it does connect to shapes, it looks unnatural when I open the presentation itself, kinda like it's rotated. However, as soon as as I move the top of the shapes, its starts to look as expected.
I've tried reading documentation (https://python-pptx.readthedocs.io/en/latest/api/shapes.html#connector-objects) but I don't see any option that changes the way Connector "looks".
Some of the code:
top_shape = shapes.add_shape(MSO_SHAPE.RECTANGLE, Inches(2), Inches(1), width, height)
for i in range(8):
bottom_shape = shapes.add_shape(MSO_SHAPE.RECTANGLE, left, top, width, height)
connector = shapes.add_connector(MSO_CONNECTOR.ELBOW, Cm(1), Cm(1), Cm(1), Cm(1))
connector.begin_connect(top_shape, 2)
connector.end_connect(bottom_shape, 0)
prs.save('test.pptx')
I expect it to look like here: https://support.office.com/en-us/article/reroute-or-move-connectors-between-shapes-da6a1212-927b-4473-967d-484182f47b3f
Here is how the presentation looks like
It seems it like, the "elbow" part is created in the 'horizontal' middle, rather than vertical. Is there any way to change how the elbow line looks like?