annotatedtimeline dates question

7 views
Skip to first unread message

D S

unread,
Dec 14, 2011, 11:23:45 AM12/14/11
to Google Visualization API
http://code.google.com/apis/chart/interactive/docs/gallery/annotatedtimeline.html

The code shows the dates as January but they appear on the chart
example as February. Why is this?

[new Date(2008, 1 ,1), 30000, undefined, undefined, 40645, undefined,
undefined],
[new Date(2008, 1 ,2), 14045, undefined, undefined, 20374,
undefined, undefined],
[new Date(2008, 1 ,3), 55022, undefined, undefined, 50766,
undefined, undefined],
[new Date(2008, 1 ,4), 75284, undefined, undefined, 14334,
'Out of Stock','Ran out of stock on pens at 4pm'],
[new Date(2008, 1 ,5), 41476, 'Bought Pens','Bought 200k
pens', 66467, undefined, undefined],
[new Date(2008, 1 ,6), 33322, undefined, undefined, 39463,
undefined, undefined]

asgallant

unread,
Dec 14, 2011, 1:47:43 PM12/14/11
to google-visua...@googlegroups.com
Javascript 0-indexes the months, so January is 0, February is 1, etc.
Reply all
Reply to author
Forward
0 new messages