I have also tried to give layers to Tree Nodes and Legend but whenever i give layername other than “Grid” to treenodes or legend then treelayout and legend stacking vertically can not overlap at all. Starting the treelayout after the legend height. Even if i grad it comes back to the same position after legend check the second screen.
If you want the legend to be in front of your tree nodes and links, you should put it in a Layer that will always be in front of your nodes and links. Maybe something like: