Repository navigation
Error in Annotated Timeline: "Object Date(...) has no method getTime" #25
Copy link
Copy link
Open
Description
What steps will reproduce the problem?
1. I've created an annotated timeline using a json wire source
2. After the annotatedtimeline.draw method is called, the type error occurs
3. This is the error output from Chrome. Other browsers have slightly different
error messages.
What is the expected output? What do you see instead?
Expected would be a working timeline chart. Instead, An alert pops up with the
above error. If I send this exact dataset to a Visualization LineChart, it
works fine.
What version of the product are you using? On what operating system?
google.load("visualization", '1', { packages: ['corechart'] });
google.load('visualization', '1', { packages: ['annotatedtimeline'] });
This is running on Vista and Windows 7, but the same happens on the deployed
version on a Windows Server.
It fails on Chrome, Firefox, IE, Safari
Please provide any additional information below.
Following is the method that calls the timeline chart. You'll notice that I've
commented out a call to a LineChart using the same date. The LineChart works
fine, but the annotated timeline produces the error.
function drawPercentSpentOverTime(gridTableData) {
try {
var chartDiv = $("#PercentSpentOverTimeChart").get(0);
//var timeline = new google.visualization.LineChart(chartDiv);
var annotatedtimeline = new google.visualization.AnnotatedTimeLine(chartDiv);
annotatedtimeline.draw(gridTableData,
{
fontSize: 10,
fontName: "Calibri",
legendFontSize: 12,
curveType: 'function',
width: 920,
hAxis: {title: 'Date', titleTextStyle: {fontSize: 12}},
vAxis: { title: 'Percent', titleTextStyle: { fontSize: 12} },
colors: ['#B98332','#FFCC33','#FF9900', '#344368', '#577647', '#871B3C' ]
});
}
catch (e) {
alert(e);
}
}
Below is the Json returned from the server. This was copied directly from
firebug:
{"status":"ok","reqId":0,"table":{"cols":[{"id":"ActualsDate","label":"Date","ty
pe":"date"},{"id":"PercentSpent","label":"Percent Of Budget
Spent","type":"number"},{"id":"TimeElapsed","label":"Percent Time
Elapsed","type":"number"}],"rows":[{"c":[{"v":"Date(2010,7,23)","f":"2010-Aug-23
"},{"v":0.241758227,"f":"0.2 %"},{"v":17.9419537,"f":"17.9
%"}]},{"c":[{"v":"Date(2010,7,24)","f":"2010-Aug-24"},{"v":0.483516455,"f":"0.5
%"},{"v":18.2058048,"f":"18.2
%"}]},{"c":[{"v":"Date(2010,7,25)","f":"2010-Aug-25"},{"v":0.725274742,"f":"0.7
%"},{"v":18.4696579,"f":"18.5
%"}]},{"c":[{"v":"Date(2010,7,26)","f":"2010-Aug-26"},{"v":0.9670329,"f":"1.0
%"},{"v":18.73351,"f":"18.7
%"}]},{"c":[{"v":"Date(2010,7,27)","f":"2010-Aug-27"},{"v":1.20879126,"f":"1.2
%"},{"v":18.99736,"f":"19.0
%"}]},{"c":[{"v":"Date(2010,7,28)","f":"2010-Aug-28"},{"v":1.45054948,"f":"1.5
%"},{"v":19.2612133,"f":"19.3
%"}]},{"c":[{"v":"Date(2010,7,29)","f":"2010-Aug-29"},{"v":1.69230771,"f":"1.7
%"},{"v":19.5250664,"f":"19.5
%"}]},{"c":[{"v":"Date(2010,7,30)","f":"2010-Aug-30"},{"v":1.98901093,"f":"2.0
%"},{"v":19.7889175,"f":"19.8
%"}]},{"c":[{"v":"Date(2010,7,31)","f":"2010-Aug-31"},{"v":2.28571415,"f":"2.3
%"},{"v":20.05277,"f":"20.1
%"}]},{"c":[{"v":"Date(2010,8,1)","f":"2010-Sep-01"},{"v":2.58241773,"f":"2.6
%"},{"v":20.3166237,"f":"20.3
%"}]},{"c":[{"v":"Date(2010,8,2)","f":"2010-Sep-02"},{"v":2.879121,"f":"2.9
%"},{"v":20.5804749,"f":"20.6
%"}]},{"c":[{"v":"Date(2010,8,3)","f":"2010-Sep-03"},{"v":3.17582417,"f":"3.2
%"},{"v":20.844326,"f":"20.8
%"}]},{"c":[{"v":"Date(2010,8,4)","f":"2010-Sep-04"},{"v":3.4725275,"f":"3.5
%"},{"v":21.10818,"f":"21.1
%"}]},{"c":[{"v":"Date(2010,8,5)","f":"2010-Sep-05"},{"v":3.76923084,"f":"3.8
%"},{"v":21.3720322,"f":"21.4
%"}]},{"c":[{"v":"Date(2010,8,6)","f":"2010-Sep-06"},{"v":3.86813164,"f":"3.9
%"},{"v":21.6358833,"f":"21.6
%"}]},{"c":[{"v":"Date(2010,8,7)","f":"2010-Sep-07"},{"v":3.967033,"f":"4.0
%"},{"v":21.8997364,"f":"21.9
%"}]},{"c":[{"v":"Date(2010,8,8)","f":"2010-Sep-08"},{"v":4.065934,"f":"4.1
%"},{"v":22.1635876,"f":"22.2
%"}]},{"c":[{"v":"Date(2010,8,9)","f":"2010-Sep-09"},{"v":4.164835,"f":"4.2
%"},{"v":22.42744,"f":"22.4
%"}]},{"c":[{"v":"Date(2010,8,10)","f":"2010-Sep-10"},{"v":4.26373625,"f":"4.3
%"},{"v":22.6912937,"f":"22.7
%"}]},{"c":[{"v":"Date(2010,8,11)","f":"2010-Sep-11"},{"v":4.362637,"f":"4.4
%"},{"v":22.9551449,"f":"23.0
%"}]},{"c":[{"v":"Date(2010,8,12)","f":"2010-Sep-12"},{"v":4.46153831,"f":"4.5
%"},{"v":23.218996,"f":"23.2
%"}]},{"c":[{"v":"Date(2010,8,13)","f":"2010-Sep-13"},{"v":4.53846169,"f":"4.5
%"},{"v":23.482851,"f":"23.5
%"}]},{"c":[{"v":"Date(2010,8,14)","f":"2010-Sep-14"},{"v":4.61538458,"f":"4.6
%"},{"v":23.7467022,"f":"23.7
%"}]},{"c":[{"v":"Date(2010,8,15)","f":"2010-Sep-15"},{"v":4.692308,"f":"4.7
%"},{"v":24.0105534,"f":"24.0
%"}]},{"c":[{"v":"Date(2010,8,16)","f":"2010-Sep-16"},{"v":4.769231,"f":"4.8
%"},{"v":24.2744064,"f":"24.3
%"}]},{"c":[{"v":"Date(2010,8,17)","f":"2010-Sep-17"},{"v":4.857143,"f":"4.9
%"},{"v":24.53826,"f":"24.5
%"}]},{"c":[{"v":"Date(2010,8,18)","f":"2010-Sep-18"},{"v":4.95604372,"f":"5.0
%"},{"v":24.80211,"f":"24.8
%"}]},{"c":[{"v":"Date(2010,8,19)","f":"2010-Sep-19"},{"v":5.054945,"f":"5.1
%"},{"v":25.0659637,"f":"25.1
%"}]},{"c":[{"v":"Date(2010,8,20)","f":"2010-Sep-20"},{"v":5.13186836,"f":"5.1
%"},{"v":25.3298168,"f":"25.3 %"}]}]}}
Original issue reported on code.google.com by moro...@gmail.com on 20 Sep 2010 at 4:13
Reactions are currently unavailable
Activity