Given any annotated time line, if you do this repeatedly, you will
find the visible portion of your chart marches by units of your time
zone with every iteration.
for (i = 0; i < 5; i++){
var range = chart.getVisibleChartRange()
chart.setVisibleChartRange(range['start'], range['end'])
}
That means getVisibleChartRange does not produce output that
setVisibleChartRange expects. But the problem is even worse than
that. You don't even have to call getVisibleChartRange repeatedly:
setVisibleChartRange alters the date objects you pass into it each
time.
var range = chart.getVisibleChartRange()
for (i = 0; i < 5; i++){
console.debug(range) // wtf, it's different every time
chart.setVisibleChartRange(range['start'], range['end'])
}
I am assuming this means that setVisibleChartRange expects dates in
your data's time zone and adjusts them to the client's time zone
internally without creating new date objects, while
getVisibleChartRange simply returns the client time that is displayed
on the chart. Either way, it's totally ignoring the time zone data in
the Date object, leading to very confusing results.
---
Btw, what I was trying to do here was synchronize all annotated
timelines on the page, so if you zoomed in one of them, all of them
would zoom to the same place. It seems I have to adjust for the time
zone every time though. They also respond to adjustments rather
slowly.
--
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.