Exemplo de Gráfico Organograma


google.charts.load('current', {packages:["orgchart"]});
google.charts.setOnLoadCallback(drawChart);

function drawChart() {
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Nome');
    data.addColumn('string', 'Gerente');
    data.addColumn('string', 'ToolTip');

    // For each orgchart box, provide the name, manager, and tooltip to show.
    data.addRows([
    [{'v':'Marcos', 'f':'Marcos<div style="color:red; font-style:italic">Presidente</div>'}, '', 'O Presidente'],
    [{'v':'Jonas', 'f':'Jonas<div style="color:red; font-style:italic">Vice Presidente</div>'}, 'Marcos', 'VP'],
    ['Maria', 'Marcos', ''],
    ['Roberto', 'Jonas', 'Bob Esponja'],
    ['Karolina', 'Roberto', '']
    ]);

    // Create the chart.
    var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
    // Draw the chart, setting the allowHtml option to true for the tooltips.
    chart.draw(data, {'allowHtml':true});
    }