only if the children have a parent and a grandparent,
if the children have only a parent, the children are organized horizontally instead of vertically.
That requires figuring out beforehand whether or not there is a grandparent – i.e. at least three levels in the tree.
Such computation could be done in a custom TreeLayout class. Or you could figure that out yourself and then set the Diagram.layout to either the TreeLayout from Org Chart Static (or a suitably modified version – whatever works for you) or else to another TreeLayout where all of the non-“alternate” properties are set to those “alternate” value from Org Chart Static. TreeLayout | GoJS API
Get your TreeLayout set up so that you get the results that you want when there’s just one parent and it has two children.
Then you’ll have two TreeLayout configurations. You can have two instances of TreeLayout, one for each set of properties and set Diagram.layout appropriately. Or you could just have one instance of TreeLayout, and you modify its properties appropriately.
Either way, I think you’ll also want to set TreeLayout.arrangement to go.TreeLayout.ArrangementHorizontal. That ensures that multiple trees are arranged horizontally.
I’m not sure i understand,
Let’s try to simplfy the scenario.
Suppose that i have a root node and 3 children nodes. I would like the children nodes to span vertically right below the root node.
When i used the Org Chart Static sample and went down to 4 nodes (1 root, 3 children), here is the result.