The Annotated Time Line select event only works when clicking on *
annotations*, not on the timeline itself.
Did you try that?

- VizBoy.

On Mon, May 11, 2009 at 5:22 PM, Churky <[email protected]> wrote:

>
> I am having problem with having event handling triggering during
> onselect:
> Here is my code: It simply print out "I AM HERE" as soon as a point on
> the timeline is clicked on. But I never get the alert.
>
> <script type='text/javascript'>
>        google.load('visualization', '1', {'packages':
> ['annotatedtimeline']});
>        google.setOnLoadCallback(drawChart);
>        function drawChart() {
>                var data = new google.visualization.DataTable();
>                data.addColumn('date', 'Date');
>                data.addColumn('number', 'A');
>                data.addColumn('string', 'title1');
>                data.addColumn('string', 'text1');
>                data.addColumn('number', 'B');
>                data.addColumn('string', 'title2');
>                data.addColumn('string', 'text2');
>                data.addColumn('number', 'C');
>                data.addColumn('string', 'title3');
>                data.addColumn('string', 'text3');
>                data.addRows(3);
>
>                data.setValue(0, 0, new Date(2008, 3, 21));
>                data.setValue(0, 1, 8);
>                data.setValue(0, 4, 1);
>                data.setValue(0, 7, 2);
>                data.setValue(1, 0, new Date(2008, 3, 22));
>                data.setValue(1, 1, 10);
>                data.setValue(1, 4, 2);
>                data.setValue(1, 7, 2);
>                data.setValue(2, 0, new Date(2008, 3, 23));
>                data.setValue(2, 1, 10);
>                data.setValue(2, 4, 2);
>                data.setValue(2, 7, 2);
>
>                var startDate = new Date();
>                startDate.setMonth( startDate.getMonth() - 3 );
>
>                var chart = new google.visualization.AnnotatedTimeLine
> (document.getElementById('A1_1_1'));
>                chart.draw(data, {'displayAnnotations':true,
> 'legendPosition':'newRow','zoomEndTime': new Date(), 'zoomStartTime':
> startDate, 'scaleType':'maximize'});
>
>                google.visualization.events.addListener(chart, 'select',
> function(e)
> {
>                        alert('I AM HERE');
>                });
>        }
> </script>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to