Hi,
I am trying to find out why the method hideDataColumns() doesn't work
for me in Annotated Time Line visualization.
I searched in the forums and I noticed that several people reported
the same problem and the reason for the problem was that they run the
code locally (file://....). I am running the code on a local web
server so this is not the problem I encountered.
The code is very basic and is based on the example at the web site.
You can test it on your machine.
Anyone has a clue?
---------------- the code -----------------
<html>
<head>
<script type='text/javascript' src='
https://www.google.com/
jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages':
['annotatedtimeline']});
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'Sold Pencils');
data.addColumn('number', 'Sold Pens');
data.addColumn('number', 'Sold notebooks');
data.addRows(6);
data.setValue(0, 0, new Date(2008, 1 ,1));
data.setValue(0, 1, 30000);
data.setValue(0, 2, 40645);
data.setValue(0, 3, 30645);
data.setValue(1, 0, new Date(2008, 1 ,2));
data.setValue(1, 1, 14045);
data.setValue(1, 2, 20374);
data.setValue(1, 3, 10374);
data.setValue(2, 0, new Date(2008, 1 ,3));
data.setValue(2, 1, 55022);
data.setValue(2, 2, 50766);
data.setValue(2, 3, 40766);
data.setValue(3, 0, new Date(2008, 1 ,4));
data.setValue(3, 1, 75284);
data.setValue(3, 2, 14334);
data.setValue(3, 3, 04334);
data.setValue(4, 0, new Date(2008, 1 ,5));
data.setValue(4, 1, 41476);
data.setValue(4, 2, 66467);
data.setValue(4, 3, 56467);
data.setValue(5, 0, new Date(2008, 1 ,6));
data.setValue(5, 1, 33322);
data.setValue(5, 2, 39463);
data.setValue(5, 3, 29463);
var annotatedtimeline = new google.visualization.AnnotatedTimeLine(
document.getElementById('chart_div'));
annotatedtimeline.draw(data, {'displayAnnotations': true});
annotatedtimeline.hideDataColumns(3);
}
</script>
</head>
<body>
<div id='chart_div' style='width: 700px; height: 240px;'></div>
</body>
</html>
------------ end of code ---------------------