无法解析查询。 Fusion Table API

时间:2015-06-20 18:36:10

标签: google-visualization google-fusion-tables

我正在尝试使用 Fusion 表格API绘制动态图表。我收到的错误信息是:

  

"无法解析查询。"

我的融合表格式是第一列的文本,第二列的日期,可视化类型的要求。这是我的代码,在下面。拜托,我做错了什么。

google.load("visualization", "1", {packages:["motionchart"]}); google.setOnLoadCallback(drawVisualization); function drawVisualization() { google.visualization.drawChart({ "containerId": "scatter", "dataSourceUrl": "//www.google.com/fusiontables/gvizdata?tq=", "query": "SELECT 'Nationality','Date','StatusofStudentship','Gender','ModeofAdmission','CourseofStudy','ProgrammeofStudy','CGPA','Race','EnglishLanguageProficiency','Disability','ModeofStudy','InternshipLength','SoftskillQuality','HealthSoundness','Employability','DefermentLength','Religion','Mode of Sponsorship',FROM " + "19mRBx3ysm3VfJQ746j8obWldgjxpw1-sBNdQy4kQ#rows:id=1", "refreshInterval": 20, "chartType": "MotionChart", "options": {} }); options['state'] = chart.draw(data, {width: 900, height:400}); '{"colorOption":"4","iconKeySettings":[],"nonSelectedAlpha":0.4,"orderedByX":false,"iconType":"BUBBLE","yAxisOption":"3","uniColorForNonSelected":false,"yZoomedDataMin":150,"dimensions":{"iconDimensions":["dim0"]},"orderedByY":false,"xZoomedIn":false,"yZoomedDataMax":617,"duration":{"multiplier":1,"timeUnit":"D"},"showTrails":true,"xAxisOption":"2","xZoomedDataMax":1200,"time":"1988","xZoomedDataMin":300,"playDuration":15000,"yLambda":1,"sizeOption":"_UNISIZE","yZoomedIn":false,"xLambda":1};'; options['width'] = 900; options['height'] = 400; } google.setOnLoadCallback(drawVisualization); 

1 个答案:

答案 0 :(得分:0)

该错误表示您的查询无效。 “ModeofSponsorship”列的名称中没有空格:

 "query": "SELECT 'Nationality','Date','StatusofStudentship','Gender','ModeofAdmission','CourseofStudy','ProgrammeofStudy','CGPA','Race','EnglishLanguageProficiency','Disability','ModeofStudy','InternshipLength','SoftskillQuality','HealthSoundness','Employability','DefermentLength','Religion','Mode of Sponsorship',FROM " + "19mRBx3ysm3VfJQ746j8obWldgjxpw1-sBNdQy4kQ#rows:id=1",

应该是:

 "query": "SELECT 'Nationality','Date','StatusofStudentship','Gender','ModeofAdmission','CourseofStudy','ProgrammeofStudy','CGPA','Race','EnglishLanguageProficiency','Disability','ModeofStudy','InternshipLength','SoftskillQuality','HealthSoundness','Employability','DefermentLength','Religion','ModeofSponsorship',FROM " + "19mRBx3ysm3VfJQ746j8obWldgjxpw1-sBNdQy4kQ#rows:id=1",

这看起来也错了:

19mRBx3ysm3VfJQ746j8obWldgjxpw1-sBNdQy4kQ#rows:id=1

可能需要从最后删除#rows:id=1