Hello, I want to capture the selected element in my timeline, but
chart.getSelection () [0]. Returns undefined.
var container = document.getElementById('timeline');
chartTimeLine = new google.visualization.Timeline(container);
dataTimeLine = new google.visualization.DataTable();
dataTimeLine.addColumn({ type: 'string', id: 'President' });
dataTimeLine.addColumn({ type: 'date', id: 'Start' });
dataTimeLine.addColumn({ type: 'date', id: 'End' });
dataTimeLine.addRows([
[ 'Washington', new Date(1789, 3, 29), new Date(1797, 2, 3) ],
[ 'Jefferson', new Date(1801, 2, 3), new Date(1809, 2, 3) ]]);
chartTimeLine.draw(dataTimeLine);
google.visualization.events.addListener(chartTimeLine, 'select',
timeLineSelected);
function timeLineSelected(){
alert(chartTimeLine.getSelection()[0].row);
}
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.