Google Charts - Organization Chart

You are Here:

How to Draw an Organization Chart?

Please wait google chart is loading...

In this example, we will draw an organization chart. Please click the boxes in the above chart to highlight particular details.

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://www.gstatic.com/charts/loader.js"></script> </head> <body> <div id="point"> </div> <script> 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', 'Manager'); data.addColumn('string', 'ToolTip'); // For each orgchart box, provide the name, manager, and tooltip to show. data.addRows([ [{v:'Larry Page', f:'Larry Page<div style="color:red;">President</div>'}, '', 'The President'], [{v:'Sundar Pichai', f:'Sundar Pichai<div style="color:red;">Vice President</div>'}, 'Larry Page', 'VP'], ['Alex', 'Larry Page', ''], ['Blake', 'Sundar Pichai', 'Bob Sponge'], ['Charlie', 'Blake', ''] ]); var options = { allowHtml:true, height:400 } var chart = new google.visualization.OrgChart(document.getElementById('point')); // Draw the chart, setting the allowHtml option to true for the tooltips. chart.draw(data, options); } </script> </body> </html>

Reminder

Hi Developers, we almost covered 98% of Google Charts Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in Google Charts.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author