简体   繁体   中英

Google Org Chart: Modify node parent

I am working with google charts for the first time and I would like to know 2 things:

  1. Is there a way in the api to update an already created node's father? Because my problem is that I have to build a tree top-down, that is to say, that I know the children of every node but not their parents, so I, first, create them empty and later set their father. However, it does not seem to work.

I have tried an approach like this one but the parent column seems to be outside of scope.

  1. how to make it stick to the container? I have tried lots of things including bootstrap and cant get the basic example to fit.

For this one, I tried this way but id did not work either.

There is no way to solve the first issue but to process the tree from the root and descend recursively to its children.

The second one, make the table fit to the container, is solved with 3 lines of css:

table { max-width: 100%; table-layout: fixed; width: 100%; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM