Google Visualization: Organizational Chart with fields named the same

試著忘記壹切 提交于 2019-12-23 05:11:46

问题


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?


回答1:


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']
]);

See example here: http://jsfiddle.net/asgallant/LPHtr/



来源:https://stackoverflow.com/questions/18276167/google-visualization-organizational-chart-with-fields-named-the-same

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!