Hi,

I am new to Viz API and I am trying to display a csv datasource in
annotated timeline chart. But the issue is that my browser doesn't
show annotated timeline chart. Please let me know what is wrong in my
code.

Here is my code:

<!DOCTYPE html>
<html>
<head>
  <title>All Examples</title>
  <!--Load the AJAX API-->
  <script type="text/javascript" src="http://www.google.com/jsapi";></
script>
  <script type="text/javascript">

  // Load the Visualization API and the ready-made Google table
visualization.
  google.load('visualization', '1', {'packages':
['annotatedtimeline']});

  // Set a callback to run when the API is loaded.
  google.setOnLoadCallback(init);

  // Send the queries to the data sources.
  function init()
        {
    var query = new google.visualization.Query('csv?url=http://
localhost:8080/myWebApp/test.csv');
    query.send(handleCsvDsResponse);
        }

  // Handle the csv data source query response
  function handleCsvDsResponse(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, {width: 600, height: 150, is3D: true});
  }

</script>
</head>

<body>

  <h1> CSV Data Source </h1>
  An annotated timeline.
  The data is taken from the csv data source.
  <div style="width: 700px; height: 300px;" id="chart_div">please
wait...</div>

</body>

</html>

Thank you all in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to