3 messages in com.googlegroups.google-visualization-api[visualization-api] Re: Questions on ...| From | Sent On | Attachments |
|---|---|---|
| kkev125 | 01 Jul 2008 12:13 | |
| VizGuy (Google) | 01 Jul 2008 23:56 | |
| kkev125 | 02 Jul 2008 08:59 |
| Subject: | [visualization-api] Re: Questions on Dataqueries and Annotated Timeline.![]() |
|---|---|
| From: | kkev125 (kkev...@hotmail.com) |
| Date: | 07/02/2008 08:59:30 AM |
| List: | com.googlegroups.google-visualization-api |
So it works? Maybe it's the server I'm using right now at work that's causing problems. I tried hard coding in the data not using google spreadsheet and it works, so it's not something wrong with the timeline. And when I just use the query url on my browser I get the correct data. I'll try this at home later. Thanks a lot VizGuy!
Kevin
On Jul 2, 1:56 am, "VizGuy (Google)" <viz...@google.com> wrote:
I just tried your code and it worked great for me. I am including the code below. This could be a temporary problem on the spreadsheet side, or that something with line-breaks messed up the query url. Make sure that the data source url parameter is on one line.
<html> <head> <script type="text/javascript" src="http://www.google.com/jsapi"></ script> <script type="text/javascript"> google.load("visualization", "1", {packages: ["annotatedtimeline"]}); google.setOnLoadCallback(initialize); function initialize() { var query = new google.visualization.Query( 'http://spreadsheets.google.com/tq?key=p0Bbv-9vLv3e9TcSbFJf- Wg&pub=1&range=A1:B83'); query.send(handleQueryResponse); }
function handleQueryResponse(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div')); chart.draw(data, {displayAnnotations: false}); } </script> </head> <body> <div id="chart_div" style="width: 700px; height: 240px;"></div> </body> </html>
On Jul 1, 12:14 pm, kkev125 <kkev...@hotmail.com> wrote:
Hey,
I'm trying to make an Annotated Timeline from a spread sheet, but I keep encountering a "Error in Query: Timeout" error. I don't think there's anything wrong with the query... could someone tell me what's causing the Timeout?
<html> <head>
<script type="text/javascript" src="http://www.google.com/jsapi"></ script> <script type="text/javascript"> google.load("visualization", "1", {packages: ["annotatedtimeline"]}); google.setOnLoadCallback(initialize);
function initialize() { // Replace data source URL on next line with your data source URL var query = new google.visualization.Query('http:// spreadsheets.google.com/tq?key=p0Bbv-9vLv3e9TcSbFJf- Wg&pub=1&range=A1:B83'); query.send(handleQueryResponse); // Send the query with a callback function
}
function handleQueryResponse(response) {
if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; }
var data = response.getDataTable();
var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div')); chart.draw(data, {displayAnnotations: false}); }
</script>
</head>
<body> <div id="chart_div" style="width: 700px; height: 240px;"></div> </body> </html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to goog...@googlegroups.com
To unsubscribe from this group, send email to
goog...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---




