That should work by itself...is there another chart drawing function in 
your code?  If so, then try this:

google.load('visualization', '1', {packages: ['annotatedtimeline']});
google.setOnLoadCallback(init);

function init () {
    // I assume the other chart is drawn in a function called drawChart1
    drawChart1();
    drawChart2();
} 

Make sure that the google.load(..) and google.setOnLoadCallback(...) appear 
only once in your code.

On Sunday, June 10, 2012 1:24:54 AM UTC-4, far m wrote:
>
> Can anyone please tell me how to show multiple instances of an ATL? I have 
> the following function but cannot make it plot twice! 
>
> google.load('visualization', '1', {packages: ['annotatedtimeline']});
> google.setOnLoadCallback(drawChart2);
>
> function drawChart2() {
>     var query2 = new google.visualization.Query('
> https://docs.google.com/spreadsheet/ccc?key=0AqzQGhNv6cV-dDVzRWdINUxycGxQcWgtcktCRG5IQ1E
> ');
>
>     // Assumes that column:
>     query2.setQuery('SELECT M,F');
>
>     // Send the query with a callback function.
>     query2.send(handleQueryResponse2);
> }
>
> function handleQueryResponse2(response2) {
>     if (response2.isError()) {
>         alert('Error in query: ' + response2.getMessage() + ' ' + 
> response2.getDetailedMessage());
>         return;
>     }
>
>     var data2 = response2.getDataTable();
>     var chart2 = new google.visualization.AnnotatedTimeLine(document.
> getElementById('chart_div2'));
>     chart2.draw(data2, {
>         displayAnnotations: true,
>         scaleColumns: [12, 1],
>         scaleType: 'allfixed'
>     });
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/UIu7TovAeSAJ.
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