Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8122275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:47:06+00:00 2026-06-06T05:47:06+00:00

I am having a problem with the Google annotated timeline. I have this function

  • 0

I am having a problem with the Google annotated timeline. I have this function (shown below) that is called in the jQuery ready function:

//creates an annotated timeline
function graphAnnotatedTimeLine(url) {
    jQuery.get(url, function(returned_data) {
        //parse returned_data ...

        //build data table
        var dataTable = new google.visualization.DataTable();
        dataTable.addColumn('datetime', columnHeadings[0]);
        dataTable.addColumn('number', columnHeadings[1]);

        //populate table
        for(var i = 0; i < rawData.length; i++) {
            var parsedData = data[i].split(",");
            dataTable.addRow([new Date(parsedData[0]), parseFloat(parsedData[1])]);
        }

        //draw graph
        var options = {displayAnnotations: false,
                       allowRedraw: true,
                       legendPosition: 'newRow',
                       displayZoomButtons: false,
                       wmode: 'transparent'};

        var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart-div'));
        chart.draw(dataTable, options);
    });
}

Called in the ready function as:

$.ready(function() {
    //generate url string
    google.setOnLoadCallback(graphAnnotatedTimeline(url));
    self.setInterval('updateGraph', 60000);
    //more stuff
});

So in the ready I call it to draw the first set of data and then set an update function to be called every minute. All the update function does is basically the same as the ready function does: build a url string and call the graph function with that url. The problem I’m having is that the graph it doesn’t display on startup. Once the update gets called once though, it displays fine after that. Is there anyone that can give me some insite as to why this is happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:47:08+00:00Added an answer on June 6, 2026 at 5:47 am

    This is because your jquery ready function is called before the google visualization script is loaded. google.setOnLoadCallback must be called like this…

        <script type="text/javascript" src='http://www.google.com/jsapi?autoload={"modules":[{"name":"visualization","version":"1","packages":["annotatedtimeline"]}]}'></script>
        <script type="text/javascript">
          google.setOnLoadCallback(graphAnnotatedTimeline(url));
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem with Google Chrome. I have a jQuery Registration form:
I'm having this problem: I have two Google maps in one page, showing just
I am having a problem with the Google map API v3, I have created
im using google maps api and im having this problem with showing the info
I'm having a duplicate JSON file problem. I have google places SBJSON files and
Basically I'm having a problem with getting google maps to tag addresses that are
I have been having a problem that has troubled me for a while. Searching
I'm having a problem on parsing a JSON from Google Places. I have the
I've been having a problem with Google maps API v.3. I have my canvas
I'm having a problem with overflow and width in Google Chrome/Webkit. This is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.