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 7603815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:44:59+00:00 2026-05-30T23:44:59+00:00

I am having an issue when trying to build an Annotated Timeline Graph using

  • 0

I am having an issue when trying to build an Annotated Timeline Graph using the Google Charts API.

In the JSON, for the first “date” column, if I use:

"v": new Date(2010, 01, 01)

Then I get a JavaScript error from my page saying that I have invalid JSON.

If instead I use:

"v": "new Date(2010, 01, 01)" then I get the error TypeError: 'undefined' is not a function (evaluating 'M[y]()').

My JavaScript code is simply a modification of the example code for a Pie Graph found at: http://code.google.com/apis/chart/interactive/docs/php_example.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript" src="scripts/jquery-1.6.2.js"></script>
    <script type="text/javascript">

    // Load the Visualization API and the piechart package.
    google.load('visualization', '1', {'packages':['annotatedtimeline']});

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

    function drawChart() {
      var jsonData = $.ajax({
          url: "getData.php",
          dataType:"json",
          async: false
          }).responseText;

      // Create our data table out of JSON data loaded from server.
      var data = new google.visualization.DataTable(jsonData);

      // Instantiate and draw our chart, passing in some options.
      var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
      chart.draw(data, {width: 400, height: 240});
    }

    </script>
  </head>

  <body>
    <!--Div that will hold the pie chart-->
    <div id="chart_div" style="height: 200px; width:200px;"></div>
  </body>
</html>

I am aware that people have had similar problems:

http://groups.google.com/group/google-visualization-api/browse_thread/thread/4cfe7f07e5ef4bcc

http://www.mail-archive.com/google-visualization-api@googlegroups.com/msg02940.html

However in these threads/pages, the answer seems to be to use "v": new Date(2010, 01, 01) however this does not work for me.

I’m not sure what I am missing here.

Thanks

  • 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-05-30T23:45:00+00:00Added an answer on May 30, 2026 at 11:45 pm

    So I finally figured it out with a little help from the Google Visualisation API user group.

    This both validates as JSON and renders correctly when using "v": "Date(2010, 01, 01)" – note the lack of the "new" keyword.

    Hopefully this helps someone else in the future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue trying to build an Xpath expression to select all the
I'm having an issue trying to build a JSONArray in android that has more
I'm trying to build 5.6.4-labs-innodb-memcached, but having this issue: # cmake ./ -- MySQL
I am having an issue with this site - http://thestamp.umd.edu/canvastest/test.html I'm trying to build
I am trying to build a custom .NET profiler using the Profiling API and
I'm trying to build an API wrapper gem, and having issues with converting hash
Hi I seem to be having an issue trying to align an H1 tag
I'm having an issue when trying to do something which should be as easy
One of my users is having an issue when trying to open an Excel
Having an issue with random individuals trying to access an intranet site with 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.