Gojs printing vertical shape

how to make childrens make it vertical when printing

i have below code

```document: newDocument, // create SVG DOM in new document context
```scale: 1

Is there any possibility to fit all the nodes in the page.

If you are using a TreeLayout as your Diagram.layout, you could try setting TreeLayout.breadthLimit. However that works best only when TreeLayout.alignment is either go.TreeLayout.AlignmentStart or go.TreeLayout.AlignmentEnd.

is there any way all the children make as vertical when print?

You could rotate them by setting or binding their angle.

Hi walter
fixed printing changing styleLayer to last parent. Still one issue is there

The print is fine if i have 3 layers. If i have 2 layers it is not.

Questions is “go.TreeLayout.StyleLastParents” is not working if i two layers. it is working fine with 3 layers.

to add more below is the layout code

	```treeStyle: go.TreeLayout.StyleLastParents,
	```arrangement: go.TreeLayout.ArrangementHorizontal,
	```angle: 90,
	```layerSpacing: 35,
	```alternateAngle: 90,
	```alternateLayerSpacing: 35,
	```alternateAlignment: go.TreeLayout.AlignmentBus,
	```alternateNodeSpacing: 20

below is the diagram

i need vertical alignment of the nodes which are blue color.

i saw below in your api
"Just like the standard layered tree style, except that the nodes with children but no grandchildren have alternate properties; This value is used for TreeLayout.treeStyle; Each TreeVertex gets its properties from its parent node; However, for those nodes whose TreeVertex.maxGenerationCount is 1, in other words when it has children but no grandchildren, the properties are copied from TreeLayout.alternateDefaults; If the tree only has two levels, the root node gets the TreeLayout.rootDefaults."

Is there any property i can set?  if there a way to stop getting properties from alternateDefaults ?

If there are no grandchildren, I suppose you could set the TreeLayout.alignment to be go.TreeLayout.AlignmentBus.

The most general solution is to override TreeLayout.assignTreeVertexValues, so that you can decide dynamically what TreeVertex properties you want to set for each node.

By the way, you probably want to set TreeLayout.arrangement to be go.TreeLayout.ArrangementVertical. That will handle cases with multiple roots.

Hi Walter
Used go.TreeLayout.AlignmentBus worked. But colors are changing

i used below code for print

var newDocument = newWindow.document;

```var svg = myDiagram.makeSvg({
```document: newDocument, // create SVG DOM in new document context
```scale: 2.35
below child node background color is changed. 

in the diagram child color is below. why the background color is changing if i use myDiagram.layout.alignment = go.TreeLayout.AlignmentBus ?

The Org Chart Editor sample includes a custom TreeLayout that assigns different colors according to the level in the tree. You’ll have to debug your app to see why it’s happening.