地理图表无法接受Google电子表格查询中的数据表格

时间:2014-02-01 19:57:39

标签: javascript html charts google-visualization geomap

在读取URL上的Excel文件时遇到问题。

可以使用条形图,折线图和饼图。

Geomap代码会出现此错误:

 google.setOnLoadCallback(drawVisualization);

HTML:

<html>
<head>
  <script type='text/javascript' src='https://www.google.com/jsapi'></script>
  <script type='text/javascript'>
   google.load('visualization', '1', {'packages': ['geochart']});
   google.setOnLoadCallback(drawChart);

function drawChart() {
  var query = new google.visualization.Query(
      'https://docs.google.com/spreadsheet/ccc?key=0Aih8-LAKMBsKdHRBSllqYkZnS2pfWWtGY2JueHdaRmc&usp=sharing,');

  query.send(handleQueryResponse);
}

function handleQueryResponse(response) {
  if (response.isError()) {
    alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
    return;
  }

          var data = response.getDataTable();

     var options = {
        sizeAxis: { minValue: 0, maxValue: 100 },
        region: 'US', // US
        displayMode: 'markers',
         colorAxis: {colors: ['#e7711c', '#4374e0']} // orange to blue
      };

      var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
      chart.draw(data, options);

    };

  </script>
</head>

<body>
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>

<head>
<title>NSF Data Online </title>
</head>


<span id='chart_div'></span>
</body>

  </head>
  <body>
    <div id="chart_div" style="width: 700px; height: 500px;"></div>
  </body>

<title>Welcome to My Web Page</title>
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii">
<meta content="MSHTML 6.00.2800.1400" name="GENERATOR">
</head>
<body>

These changes must be reflected in the web page .

</body>

<hr>

</html>

0 个答案:

没有答案