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> |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | + | ||
- | <script | + | <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('https://docs.google.com/spreadsheet/pub?key=0ArsDNt8sj-LBdEdCREdxUTFmVXpPaTVnZm43d0RTdmc&single=true&gid=0&output=html'); | ||
- | + | 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 11:58, 2 September 2013