Google Visualization: Organizational Chart with fi

2019-06-14 14:47发布

问题:

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/