Generating Organization chart

Hi,
I am trying to generate a organization chart without using smart art which will provide by default. I am trying create it through the auto shapes and connectors. Can you please suggest me how to calculate the positions and co-ordinates for placing the shapes in the PPT. example is like when will generate it through the smart art automatically it will adjust the shape sizes and positions.

@janaki527,
Thank you for your query. To understand your issue better, could you share the presentation example containing the organization chart you mentioned, please?
Also please specify the programming language you are using with Aspose.Slides.

example.JPG (7.1 KB)

I am using .net core.

If you see the diagram the shapes are overlapping and getting more spaces.

@janaki527,
You can use auto shapes and connectors for such a diagram. You should analyze and calculate the position and size of the shapes for the next shapes. Please look at the next example:

const float startPositionX = 300;
const float startPositionY = 20;
const float shapeWidth = 50;
const float shapeHeight = 30;
const int shapeGapY = 20;

using (var presentation = new Presentation())
{
    var slide = presentation.Slides[0];

    var shape1 = slide.Shapes.AddAutoShape(ShapeType.Rectangle, startPositionX, startPositionY, shapeWidth, shapeHeight);

    var shape2X = shape1.X - shape1.Width;
    var shape2Y = shape1.Y + shape1.Height + shapeGapY;
    var shape2 = slide.Shapes.AddAutoShape(ShapeType.Rectangle, shape2X, shape2Y, shapeWidth, shapeHeight);

    var connector1 = slide.Shapes.AddConnector(ShapeType.BentConnector2, 0, 0, 0, 0);
    connector1.StartShapeConnectedTo = shape1;
    connector1.StartShapeConnectionSiteIndex = 2;
    connector1.EndShapeConnectedTo = shape2;
    connector1.EndShapeConnectionSiteIndex = 0;

    var shape3X = shape1.X + shape1.Width;
    var shape3Y = shape1.Y + shape1.Height + shapeGapY;
    var shape3 = slide.Shapes.AddAutoShape(ShapeType.Rectangle, shape3X, shape3Y, shapeWidth, shapeHeight);

    var connector2 = slide.Shapes.AddConnector(ShapeType.BentConnector2, 0, 0, 0, 0);
    connector2.StartShapeConnectedTo = shape1;
    connector2.StartShapeConnectionSiteIndex = 2;
    connector2.EndShapeConnectedTo = shape3;
    connector2.EndShapeConnectionSiteIndex = 0;

    presentation.Save(dataPath + "output.pptx", SaveFormat.Pptx);
}

Result: output.zip (21.1 KB)
More details: Connector
API reference: AddAutoShape Method, AddConnector Method, ShapeType Enumeration

Thank you for the update. I will try the approach.

HI ,
I am trying to generate below image.
image.png (413 Bytes)
but I am getting the output in different way. Please check the below image. when I move the 2nd image I am able to see the connector between shape2 and 3. But by default connector is not showing.
image.png (415 Bytes).

Below is the code i have used.

var slide = pres.Slides[0];
var shape1 = slide.Shapes.AddAutoShape(ShapeType.Rectangle, startPositionX, startPositionY, shapeWidth, shapeHeight);
var shape2X = shape1.X - shape1.Width;
var shape2Y = shape1.Y + shape1.Height + shapeGapY;
var shape2 = slide.Shapes.AddAutoShape(ShapeType.Rectangle, shape2X, shape2Y, shapeWidth, shapeHeight);
var connector1 = slide.Shapes.AddConnector(ShapeType.BentConnector2, 0, 0, 0, 0);
connector1.StartShapeConnectedTo = shape1;
connector1.StartShapeConnectionSiteIndex = 2;
connector1.EndShapeConnectedTo = shape2;
connector1.EndShapeConnectionSiteIndex = 0;
var shape3X = shape1.X + shape1.Width;
var shape3Y = shape1.Y + shape1.Height + shapeGapY;
var shape3 = slide.Shapes.AddAutoShape(ShapeType.Rectangle, shape3X, shape3Y, shapeWidth, shapeHeight);
var connector2 = slide.Shapes.AddConnector(ShapeType.BentConnector2, 0, 0, 0, 0);
connector2.StartShapeConnectedTo = shape1; connector2.StartShapeConnectionSiteIndex = 2;
connector2.EndShapeConnectedTo = shape3; connector2.EndShapeConnectionSiteIndex = 0;
var connector3 = slide.Shapes.AddConnector(ShapeType.StraightConnector1, 0, 0, 0, 0);
connector3.StartShapeConnectedTo = shape2;
connector3.StartShapeConnectionSiteIndex = 3;
connector3.EndShapeConnectedTo = shape3;
connector3.EndShapeConnectionSiteIndex = 1;

Please suggest me how to fix the issue.

@janaki527,
Unfortunately, I have not managed to reproduce the issue. Your code example is correct. Please share your output presentation file and specify the version of PowerPoint you are using.