I'm just starting with JS using some basic google charts and I ran into a little problem. First, this is the full code:
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {packages:["orgchart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('string', 'Predecessor');
data.addColumn('string', 'ToolTip');
data.addRows([
['Mary', '', ''],
['John', 'Mary', '']
]);
var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
chart.draw(data, {'allowHtml':true});
}
</script>
</head>
<body>
<div id="chart_div"></div>
</body>
</html>
The way I need it to work is, getting data from another archive (txt, json, xml...). In short, I need ['Mary', '', ''], ['John', 'Mary', ''] to be fetched there, and this function just having the reference to that archive.
Thanks for the help, I know that this issue is probably extremely simple, but I think I'm using the wrong words to describe it, cause I don't find it anywhere.