I'm using Google's Visualization: Organizational Chart library,
Link to documentation: https://developers.google.com/chart/interactive/docs/gallery/orgchart
I'm trying to change the style and create links for each node.
I've been trying to use:
chart.setRowProperty((nodenumber), 'style', 'background-color:#FFF');
for each node but unsuccessfully. Wherever I place that code just crashes the script. Any idea why? What would be the best way to create links from each independent node?
Javascript:
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['orgchart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'name');
data.addColumn('string', 'parent');
data.addColumn('string', 'hover');
data.addRows([
['Parent', '', ''],
['Kid1', 'Parent', ''],
['Kid2', 'Parent', ''],
['GreatKid3', 'Kid1', ''],
['GreatKid4', 'Kid1', ''],
['GreatKid5', 'Kid2', ''],
['GreatGreatKid6', 'GreatKid5', ''],
['GreatGreatKid7', 'GreatKid5', ''],
]);
var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
chart.draw(data, {allowHtml:true, allowCollapse:true});
chart.collapse(1,true);
chart.collapse(2,true);
}
</script>
CSS
#chart_div{
width:800px;
}
HTML
<body>
<div id='chart_div'></div>
</body>