Team:TU-Delft/SynBioData
From 2013.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
<html> | <html> | ||
- | + | <head> | |
- | < | + | <meta charset="UTF-8"> |
- | + | ||
- | + | ||
- | < | + | <title>Fusion Tables API Example: Google Chart Tools Data Table</title> |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | <link href="/apis/fusiontables/docs/samples/style/default.css" | |
- | + | rel="stylesheet" type="text/css"> | |
- | </ | + | <script type="text/javascript" src="http://www.google.com/jsapi"></script> |
- | + | <script type="text/javascript"> | |
- | + | google.load('visualization', '1', { packages: ['table'] }); | |
+ | function drawTable() { | ||
+ | var query = "SELECT 'Scoring Team' as Scoring, " + | ||
+ | "'Receiving Team' as Receiving, 'Minute of goal' as Minute " + | ||
+ | 'FROM 1VlPiBCkYt_Vio-JT3UwM-U__APurJvPb6ZEJPg'; | ||
+ | var team = document.getElementById('team').value; | ||
+ | if (team) { | ||
+ | query += " WHERE 'Scoring Team' = '" + team + "'"; | ||
+ | } | ||
+ | var queryText = encodeURIComponent(query); | ||
+ | var gvizQuery = new google.visualization.Query( | ||
+ | 'http://www.google.com/fusiontables/gvizdata?tq=' + queryText); | ||
- | + | gvizQuery.send(function(response) { | |
+ | var table = new google.visualization.Table( | ||
+ | document.getElementById('visualization')); | ||
+ | table.draw(response.getDataTable(), { | ||
+ | showRowNumber: true | ||
+ | }); | ||
+ | }); | ||
+ | } | ||
- | + | google.setOnLoadCallback(drawTable); | |
- | + | </script> | |
- | + | </head> | |
- | + | <body> | |
- | + | <div> | |
- | + | <label>Scoring Team:</label> | |
- | + | <select id="team" onchange="drawTable();"> | |
- | + | <option value="">All</option> | |
- | + | <option value="Germany">Germany</option> | |
- | + | <option value="New Zealand">New Zealand</option> | |
- | + | <option value="Uruguay">Uruguay</option> | |
- | + | </select> | |
- | + | </div> | |
- | + | <div id="visualization"></div> | |
- | </ | + | </body> |
</html> | </html> |
Revision as of 13:14, 2 September 2013