We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Creating an OrganizationChart type layout (SmartArtLayoutType) with more than 20+ SmartArtNode nodes takes too much time?

I am trying to build an organisation chart using following code:

	Presentation pres = new Presentation();

	// Access the presentation slide
	ISlide slide = pres.getSlides().get_Item(0);

	// Add Smart Art IShape
	ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.OrganizationChart);

	ISmartArtNode parentNode = smart.getAllNodes().get_Item(0);

	parentNode.getTextFrame().setText("H S Bhartia\nCCMD");

	while (parentNode.getChildNodes().size() > 0) {
		parentNode.getChildNodes().removeNode(0);
	}

	SmartArtNode chNode0_1 = (SmartArtNode) ((SmartArtNodeCollection) parentNode.getChildNodes()).addNodeByPosition(0);
	chNode0_1.getTextFrame().setText("Raju Sunil Mistry\nChief Human Resources Officer");

	SmartArtNode chNode1 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(0);
	chNode1.getTextFrame().setText("Shivshant Kumar\nGeneral Manager - HRIS");

	SmartArtNode chNode1_1 = (SmartArtNode) ((SmartArtNodeCollection) chNode1.getChildNodes()).addNodeByPosition(0);
	chNode1_1.getTextFrame().setText("Krishan Kumar Singh\nSenior Manager - HRIS");

	SmartArtNode chNode1_2 = (SmartArtNode) ((SmartArtNodeCollection) chNode1.getChildNodes()).addNodeByPosition(1);
	chNode1_2.getTextFrame().setText("Mayank Sunny\nManager - HRIS");

	SmartArtNode chNode2 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(1);
	chNode2.getTextFrame().setText("Hreetesh Bhandari\nSenior Manager - HR");

	SmartArtNode chNode3 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(2);
	chNode3.getTextFrame().setText("Mukesh Singh Bhadauria\nAVP & Head - Compensation & Benefits");

	SmartArtNode chNode4 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(3);
	chNode4.getTextFrame().setText("Geo Jacob P.P.\nExecutive Assistant");
	chNode4.setAssistant(true);

	// Save Presentation
	pres.save("C:\\Users\\userDefault\\Desktop\\example.pptx", SaveFormat.Pptx);

Creating this chart itself takes 30-40 seconds. I want to create large charts with 60-70+ nodes.

My company, Jubilant Life Sciences, is in the middle of a project in which we need to make an org chart according to the selected employee by accessing his parent-child nodes through a database table.

We are quite interested in purchasing the licenses of your ASPOSE Slides APIs, but we are stuck at the problem that I have mentioned above and it’s very critical.

Please suggest a solution to this problem.

@tanujd_203,

Thank you for your growing interest in Aspose.Slides.

I have observed your following requirement and have also worked with sample code shared by you to generate the organizational chart. The generated chart does not have issue and you can add nodes via loading data from database as well. As far as time taken for adding SmartArt nodes is concerned, it took 17 seconds on my end to generate the presentation. It is fine and if you feel any issue then please share the time taken for adding complete nodes along with complete working sample. I will discuss that further with our product team and we will investigate if performance can be increased. I also suggest you to please try using Aspose.Slides for .NET as it has better performance as compared to Aspose.Slides for Java.

Many Thanks,

Mudassir Fayyaz

Okay. How much difference is there in the time taken to run a same process in Java vs .NET?

@tanujd_203,

I like to share that there is no benchmark data available in this regard. However, you will observe noticeable change in performance as Aspose.Slides for Java is created by porting from Aspose.Slides for .NET.

Many Thanks,

Mudassir Fayyaz