Googlechart prototype: Difference between revisions

From Yocto Project
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
<nowiki>
{| class="wikitable"
<html>
!colspan="6"|Shopping List
  <head>
|-
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|rowspan="2"|Bread & Butter
    <script type="text/javascript">
|Pie
      google.charts.load('current', {'packages':['table']});
|Buns
      google.charts.setOnLoadCallback(drawTable);
|Danish
 
|colspan="2"|Croissant
      function drawTable() {
|-
        var data = new google.visualization.DataTable();
|Cheese
        data.addColumn('string', 'Name');
|colspan="2"|Ice cream
        data.addColumn('number', 'Salary');
|Butter
        data.addColumn('boolean', 'Full Time Employee');
|Yogurt
        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>
    <div id="table_div"></div>
  </body>
</html>
</nowiki>

Revision as of 03:27, 13 December 2018

Shopping List
Bread & Butter Pie Buns Danish Croissant
Cheese Ice cream Butter Yogurt