Could you please explain your idea clearly?
In my opinion, I want to build a tree node look like this:
public class Node {
public int uniqueId;
public int parentId;
public String name;
public List<Node> children = new ArrayList<Node>();
public List<Node> parent = new ArrayList<Node>();
}

And Data table used to create chart as below:
UniqueId | ManagerId | Name