I implemented Annotated Time Line for my app only to find that the
date on the graph is incorrect - it adds one month. Date(2008, 1 ,1,
13, 45, 00) appears as February 01, 2008.
Is it a bug, or am I doing something wrong?
<html>
<head>
<script type='text/javascript' src='http://www.google.com/jsapi
'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages':
['annotatedtimeline']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'Date');
data.addColumn('number', 'Sold Pencils');
data.addRows(6);
data.setValue(0, 0, new Date(2008, 1 ,1, 13, 45, 00));
data.setValue(0, 1, 30000);
data.setValue(1, 0, new Date(2008, 1 ,1, 15, 55, 00));
data.setValue(1, 1, 14045);
data.setValue(2, 0, new Date(2008, 1 ,1, 22, 10, 00));
data.setValue(2, 1, 55022);
data.setValue(3, 0, new Date(2008, 1 ,2, 02, 20, 00));
data.setValue(3, 1, 75284);
data.setValue(4, 0, new Date(2008, 1 ,2, 10, 45, 00));
data.setValue(4, 1, 41476);
data.setValue(5, 0, new Date(2008, 1 ,2, 12, 00, 00));
data.setValue(5, 1, 33322);
var chart = new
google.visualization.AnnotatedTimeLine(document.getElementById('chart_div') );
chart.draw(data, {});
}
</script>
</head>
<body>
<div id='chart_div' style='width: 700px; height: 240px;'></div>
</body>
</html>
Notes:
1. the above code is not mine (I pulled it from a post by VizGuy:
http://groups.google.com/group/google-visualization-api/browse_thread/thread/12758bc9dc71058c
)
2. I haven't tried it with any other graph type.
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.