Defining Spots

Hi,

While working on GoXam charts, a situation arised where my node data template changed and became a little complex and bigger in size. here is its screenshot:

Can you see my root node. Now bydefault the links connects from the center of the node(shown as red in color in screenshot). I dont want them to do that. I want them to connect to the point where that vertical black line under Trianlge shape ends. Is it achievable?? This is in silverlight and I used TreeModel.

By default the TreeLayout assigns the spots at which links connect.
The default FromSpot for a tree that is growing downwards (90 degrees) is MiddleBottom;
the default ToSpot is MiddleTop.

You can prevent TreeLayout from using one or both of those defaults by setting TreeLayout.SetsPortSpot and/or SetsChildPortSpot to false.
It looks like you only need to set SetsPortSpot=“False”.

You need to specify the go:Node.FromSpot to be where you want it to be.
It looks like in your case you want it to be a fixed distance from the bottom left corner.
So your XAML for the root node could include the attribute go:Node.FromSpot=“0 1 40 0”.
Or something like that, substituting half the width of your green triangle for my guess of “40”.

Thanks Mr. Walter. I achieved what I wanted. But it raised another problem. See the screenshot:

If you can see the selected node and its siblings are connected to its parent node. But at wrong spot. The connection should have started from MiddleBottom of parent node. Plus wherever I add a new node the connector starts from the spot which i defined for root node’s FromSpot.

I dont want this to happen, please suggest me something.

Secondly, the Root’s child nodes aren’t center aligned. How can they be aligned center??

It looks like you set the FromSpot on most of those green parent nodes to something near the bottom-left corner, instead of setting them to MiddleBottom.

Secondly, the root node’s children are centered about the root node.
But I’m guessing that you want the children to be centered about the green triangle inside the root node.
To do that, give that green triangle an x:Name, set the go:Node.LocationElementName to that same name, and set go:Node.LocationSpot=“Center”.
Now the root node’s Location will be the center of that green triangle.