Google Visualization:组织结构图,其中的字段命名相同 [英] Google Visualization: Organizational Chart with fields named the same

查看:87
本文介绍了Google Visualization:组织结构图,其中的字段命名相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google可视化:组织结构图 LINK
和结构工作得很好,但是我不能在同一行中命名2个或更多同名的
的字段?我应该能够做到这一点?任何想法?

I am using Google Visualization: Organizational Chart LINK and structure is working very well, however I cannot named 2 or more fields with the same name in 1 row? I should be able to do that? Any ideas?

推荐答案

OrgCharts要求每个节点都有一个唯一的ID,但是可以将这些节点的格式化值更改为是一样的:

The OrgCharts require that each node have a unique ID, but you can change the formatted value of those nodes to be the same:

var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('string', 'Parent');

data.addRows([
    [{v: 'parent_node', f: 'Parent Node'}, null],
    [{v: 'child_node_1', f: 'Child Node'}, 'parent_node'],
    [{v: 'child_node_2', f: 'Child Node'}, 'parent_node']
]);

查看示例: http://jsfiddle.net/asgallant/LPHtr/

这篇关于Google Visualization:组织结构图,其中的字段命名相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆