简体   繁体   English

Google组织结构图:修改节点父级

[英]Google Org Chart: Modify node parent

I am working with google charts for the first time and I would like to know 2 things: 我是第一次使用Google图表,我想知道2件事:

  1. Is there a way in the api to update an already created node's father? api中是否有办法更新已创建的节点的父亲? 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. 对于这个,我尝试过这种方式,但是id也不起作用。

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: 第二个,使表适合容器,用3行css解决:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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