Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The Fusion Tables SQL queries are deprecated. The new version of the API is not limited to 500 rows, see the <a href="https://developers.google.com/fusiontables/" rel="nofollow">Fusion Tables API</a> for details.</p> <p>Edit:</p> <p>Here is an example Dashboard using the Google Fusion Tables code Odi posted in comments below:</p> <pre><code>function drawTable(response) { var data = new google.visualization.DataTable(); data.addColumn('string', 'Country Name'); data.addColumn('number', 'Population in 1960'); data.addColumn('number', 'Population in 2000'); var rows = []; for (var i = 0; i &lt; response.rows.length; i++) { rows.push([response.rows[i][0], parseInt(response.rows[i][1]), parseInt(response.rows[i][2])]); } data.addRows(rows); var table = new google.visualization.ChartWrapper({ containerId: 'table_div', chartType: 'Table', options: { } }); var control = new google.visualization.ControlWrapper({ containerId: 'control_div', controlType: 'StringFilter', options: { filterColumnIndex: 0 } }); var dashboard = new google.visualization.Dashboard(document.querySelector('#dashboard')); dashboard.bind([control], [table]); dashboard.draw(data); } function getData() { // Builds a Fusion Tables SQL query and hands the result to dataHandler var queryUrlHead = 'https://www.googleapis.com/fusiontables/v1/query?sql='; var queryUrlTail = '&amp;key=AIzaSyCAI2GoGWfLBvgygLKQp5suUk3RCG7r_ME'; var tableId = '17jbXdqXSInoNOOm4ZwMKEII0sT_9ukkqt_zuPwU'; // write your SQL as normal, then encode it var query = "SELECT 'Country Name', '1960' as 'Population in 1960', '2000' as 'Population in 2000' FROM " + tableId + " ORDER BY 'Country Name' LIMIT 10"; var queryurl = encodeURI(queryUrlHead + query + queryUrlTail); var jqxhr = $.get(queryurl, drawTable, "jsonp"); } google.load('visualization', '1', {packages:['controls'], callback: getData}); </code></pre> <p>See it working here: <a href="http://jsfiddle.net/asgallant/6BXsy/" rel="nofollow">http://jsfiddle.net/asgallant/6BXsy/</a></p> <p>Give the date format <code>yyy-mm-dd</code>, this is how you would create Date objects from it:</p> <pre><code>var data = new google.visualization.DataTable(); data.addColumn('date', 'Date'); // other columns var rows = [], dateArray, year, month, day; for (var i = 0; i &lt; response.rows.length; i++) { dateArray = response.rows[i][0].split('-'); year = parseInt(dateArray[0]); month = parseInt(dateArray[1]) - 1; day = parseInt(dateArray[2]); rows.push([new Date(year, month, day) /*, other data */]); } data.addRows(rows); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload