Hi, I'm trying to use rangechange on the annotated timeline. The goal
is to show sparse data when the user is showing the full range of the
timeline, and fetch more detail when they zoom in.

I hooked up the rangechange event, and indeed it is firing when the
range is changed. I am able to query for more data. But, when I set
the data into the ATL, and redraw, the rangechange fires again. It
also fires on the first chart.draw().

So, can anyone give some advice on a way I can use the dataset, and
chart.draw() without triggering rangechange. I tried looking for a way
to see if I can see what the current range is set to, but I can't see
a way to get that out of the chart object.

Thanks,

Steve

------------
Here's some of my code...


function getChart(begin, end) {
    var query = new google.visualization.Query(
            '/data/?begin='+begin+'&end='+end);

    query.setTimeout(120);
    query.send(drawChart);
}

function drawChart(response) {
    if (response.isError()) {
        alert('error in query: '+response.getMessage() + '' +
                response.getDetailedMessage() );
    } else {
        var chart = new google.visualization.AnnotatedTimeLine
(document.getElementById('chart_div'));
        google.visualization.events.addListener(chart, 'rangechange',
                rangeChanged);

        var data = response.getDataTable();

        chart.draw(data, {
                displayAnnotations: true,
                scaleType: "allfixed",
                scaleColumns: [ 0, 2]
                });


    }
}
function rangeChanged(range) {
    getChart(range.start.getTime()/1000, range.end.getTime()/1000);
}

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