Googlechart prototype

From Yocto Project
Revision as of 03:08, 13 December 2018 by Yeoh, Ee Peng (talk | contribs) (Created page with "<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('curre...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

<html>

 <head>
   <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
   <script type="text/javascript">
     google.charts.load('current', {'packages':['table']});
     google.charts.setOnLoadCallback(drawTable);
     function drawTable() {
       var data = new google.visualization.DataTable();
       data.addColumn('string', 'Name');
       data.addColumn('number', 'Salary');
       data.addColumn('boolean', 'Full Time Employee');
       data.addRows([
         ['Mike',  {v: 10000, f: '$10,000'}, true],
         ['Jim',   {v:8000,   f: '$8,000'},  false],
         ['Alice', {v: 12500, f: '$12,500'}, true],
         ['Bob',   {v: 7000,  f: '$7,000'},  true]
       ]);
       var table = new google.visualization.Table(document.getElementById('table_div'));
       table.draw(data, {showRowNumber: true, width: '100%', height: '100%'});
     }
   </script>
 </head>
 <body>
 </body>

</html>