简体   繁体   English

Google Orgchart图和现有连接的文本(节点之间)

[英]Google Orgchart graph and the text for existing connections (between nodes)

I have a question about Visualization: Google Organizational Chart 我对可视化有疑问:Google组织结构图

Everything is perfect. 一切都很完美。 The only thing I want is to add possible comments (some text) for existing connections between the nodes. 我唯一想做的就是为节点之间的现有连接添加可能的注释(一些文本)。 How can I do that? 我怎样才能做到这一点?

PS I see I can add ToolTips for each node. PS我看到我可以为每个节点添加工具提示。 But what about text between the connected nodes? 但是,连接的节点之间的文本呢?

Thank you. 谢谢。

Ok, if anyone is interested in my solution, here it is: 好吧,如果有人对我的解决方案感兴趣,可以在这里:

  <style>/*please add styles after .js files, so it won't be overwritten*/
    .google-visualization-orgchart-connrow-medium {
        height: 64px;/*changed to a higher value so I could put some text in between nodes*/
    }
    .label{
        color:red; font-style:italic; border:1px solid red;
        position: absolute;
        margin-top:-60px;
    }
  </style>

Please add <div class="label">My text between nodes</div> right inside the node string value. 请在节点字符串值内添加<div class="label">My text between nodes</div> Example: 例:

data.addRows([
  ...
    ['John<div class="label">Brother</div>', 'Lewis'],
  ...
]);

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

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