Zoom like Google finance charts

637 views
Skip to first unread message

Voit

unread,
Aug 24, 2009, 11:01:14 AM8/24/09
to Google Visualization API
Hello, I have 1 question. Does Google api should automatically show/
hide values of chart on zoom? There is no such functionality in
documentation as i see.
Please advise.

ChartMan

unread,
Aug 26, 2009, 3:23:11 PM8/26/09
to google-visua...@googlegroups.com
Some of the visualizations support zoom and others (most of them don't). What chart are you using?

ChartMan

Voit

unread,
Aug 27, 2009, 1:02:15 PM8/27/09
to Google Visualization API
I'm using annotated timeline. Id like to know how to make zoom
working like in Google finance. I mean is there ability to hide values
(points) when zoom out, and show more detailed graph when zoom in? As
i see it implemented in google finance without chart redraw.

Voit

unread,
Sep 1, 2009, 1:46:47 PM9/1/09
to Google Visualization API
Does anybody have information I need - how to make Annotated timeline
to show/hide values on zoom ?
Message has been deleted
Message has been deleted

Bob

unread,
Sep 2, 2009, 8:32:22 AM9/2/09
to Google Visualization API
Volt,
You might not like the answer, but in general, what you're going to
need to do is to re-query for the higher (or lower) resolution data
when you zoom.
You can get intercept the zoom events by adding a listener for the
'rangechange' event and then seeing what the old and new limits of the
range are. Based on those limits, you'd re-query your source and
redraw that AnnotatedTimeLine for that new data set.
Of course, when you needed to zoom out, you'd need to do the same,
but this time, getting the *lower* resolution data.
It's not ideal, but that's as good as you can currently do with the
AnnotatedTimeLine.
I, too, wish there were a more feature-rich data buffering scheme
with the ATL... but at current, there just isn't.

Bob

Zach Dwiel

unread,
Sep 2, 2009, 3:04:39 PM9/2/09
to Google Visualization API
Bob: do you have any clean working code to use as an example?

I've been working on a similar hack, which relies on hideDataColumns
and showDataColumns columns (using a column for each level of zoom).
However, sometimes, the range gets messed up. This seems to happen
because it gets to a state between switching columns where there are
no columns displayed instead of despite a specific order of operations
in the code.

Do you have something that works?

I'd be happy to share some of my code if anyone is interested in
trying to get it straightened out. It works for the most part.

thanks

zach

Bob

unread,
Sep 3, 2009, 7:08:19 AM9/3/09
to Google Visualization API
Zach,
What I've got is a need, and the realization that all the things
I've tried have failed for me. They can be made to work in a fashion,
but I need production code, and these are just not doing it.
So I've held off and made it something the user has to ask for in
the GUI.
There's also the annoying "white out" when redrawing an ATL with a
lot of data, but that I've solved by a simple double-buffering scheme
of having two ATLs at the same location in the page and drawing to the
"background" one and then flipping them with the CSS zIndex property.
That works very nicely and it gives me nearly instant updating of
the data.
However, I can't say that I've cracked the other.
Sorry.

Bob

VizGuy

unread,
Sep 6, 2009, 8:37:05 AM9/6/09
to google-visua...@googlegroups.com
Hi,


So as mentioned in this thread, there is no implementation for re-query-ing that is part of the library.

If anyone has a general use implementation, we will have to add a link from our tools gallery (http://code.google.com/apis/visualization/documentation/toolsgallery.html)


Regards,
VizGuy

Bob Light

unread,
Sep 17, 2009, 2:11:51 PM9/17/09
to Google Visualization API
I guess I would like to second the call... it would be great to have a
way to alter the datatable underlying an ATL (or perhaps any dataviz
object) and then tell the dataviz object to refresh itself.

The application I am trying to do is a "chart recorder" application.
There is too much data to download to the client so depending on the
zoomscale, I would like different datasets to be used.

1) when zoomed out with a large timescale...the resolution of the data
would be rather coarse
2) when zoomed in to a small timescale (several seconds or minutes of
data)...I'd like the data to be at full resolution.

- Bob

On Sep 6, 8:37 am, VizGuy <viz...@google.com> wrote:
> Hi,
>
> So as mentioned in this thread, there is no implementation for re-query-ing
> that is part of the library.
>
> If anyone has a general use implementation, we will have to add a link from
> our tools gallery (http://code.google.com/apis/visualization/documentation/toolsgallery....)
>
> Regards,
> VizGuy

Scarlett

unread,
Sep 18, 2009, 9:07:09 AM9/18/09
to Google Visualization API
I would like to third the call ...

MentalPower

unread,
Sep 18, 2009, 3:13:14 PM9/18/09
to Google Visualization API
Fourth...

VizGuy

unread,
Sep 20, 2009, 4:51:58 PM9/20/09
to google-visua...@googlegroups.com
Got the message :)

If you will look into this issue, and try to find a generic way to handle it, you will notice that this is not a trivial task.
However, we are aware of the power of enabling drill down and roll up on charts, without letting the user code the flow.

We are looking into it, and I hope we come up with something, but I can't specify details or timelines yet.

Regards,
VizGuy

Scarlett

unread,
Sep 30, 2009, 11:24:29 AM9/30/09
to Google Visualization API
I think one approach would be to try and achieve a target number of
data points per horizontal pixels (I find somewhere between 15:1 and
6:1 pixels per data point a reasonable density/resolution).

The trick is that one may need to define the time resolution steps in
an even manner (i.e. going from second to minutes is a 60x reduction
in resolution, mins to hrs 60x, hrs to days 24x, days to wks 7x, wks
to mnths 4.3x, mnths to years 12x, yrs to decades, 10x). This would
take some thought to make sure the re-queries didn't chunk the data.

If I had the skills, I would re-query the data source based on the
required resolution. In Oracle SQL I often take the average of a
column of data and GROUP BY hour/day/month/year to get different
"resolutions" of data.

Just a thought.

Here's sample SQL code:
[code]
SELECT TO_CHAR(date_column, 'yyyy-mm') AS new_date_resolution,
-- change 'yyyy-mm' to 'yyyy' or 'yyyy-mm-dd' ....
ROUND(AVG(data_set_1),1),
ROUND(AVG(data_set_2),1),
ROUND(AVG(data_set_3),1)
FROM table_name
GROUP BY TO_CHAR(date_column, 'yyyy-mm') -- change 'yyyy-mm' to
'yyyy' or 'yyyy-mm-dd' ....
[/code]
Reply all
Reply to author
Forward
0 new messages