Bug: Visualization: Annotated Time Line?

1 view
Skip to first unread message

ngchanman

unread,
Apr 28, 2009, 12:56:52 PM4/28/09
to Google Visualization API
For the following URL: http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html
The example data states January for the data point:

However the exmaple graph starts from February.

....

data.setValue(0, 0, new Date(2008, 1 ,1));
data.setValue(0, 1, 30000);
data.setValue(0, 4, 40645);
data.setValue(1, 0, new Date(2008, 1 ,2));
data.setValue(1, 1, 14045);
data.setValue(1, 4, 20374);
data.setValue(2, 0, new Date(2008, 1 ,3));
data.setValue(2, 1, 55022);
data.setValue(2, 4, 50766);
data.setValue(3, 0, new Date(2008, 1 ,4));
....


Is this a bug in the API or is the date incorrctly formatted?

ngchanman

unread,
Apr 29, 2009, 2:23:51 AM4/29/09
to Google Visualization API
Apologies for the double post.

On Apr 28, 5:56 pm, ngchanman <ngchan...@gmail.com> wrote:
> For the following URL:http://code.google.com/apis/visualization/documentation/gallery/annot...

Churk Y. Leung

unread,
Apr 29, 2009, 7:36:11 AM4/29/09
to google-visua...@googlegroups.com
It is not a bug, it is how the programming world does things. Just like an empty array start at 0, So therefore the month starts at 0 also. Which means Jan = 0, and Feb = 1. I didnt noticed this at first when I started implementing my app, but very quickly realize and just subtract 1 from the month will give you the value you need.

Churk Y. Leung
chu...@gmail.com

VizGuy

unread,
Apr 29, 2009, 4:27:59 PM4/29/09
to google-visua...@googlegroups.com
We could only apologize in the name of js.... :)

Between this ugly Date implementation, and not using js date, we preferred the first (and still think its better).

VizGuy
Reply all
Reply to author
Forward
0 new messages