Re: Help on a visualization

43 views
Skip to first unread message

asgallant

unread,
Dec 7, 2012, 11:31:45 PM12/7/12
to google-visua...@googlegroups.com
It might help to build the chart with static data first, and once you've got that working, figure out how you would like to apply the control(s) to it.  In that example, the data is aggregated over the selected time period and displayed in the GeoChart - is that what you are trying to do here?

On Friday, December 7, 2012 9:56:39 PM UTC-5, J.J. Gallagher wrote:
Hi - I apologize if the answer to this is obvious... I am looking to apply a control to a geomap, or a geochart to display various datasets over time. I looked at adapting some of the code listed in the playground under dashboards and controls, but have not have had success. I also looked at adapting this code: http://jsfiddle.net/asgallant/Fs3Hb/ but can't get it running 

Could someone point me in the right direction?

Thanks very much 


J.J. Gallagher

unread,
Dec 8, 2012, 12:50:30 PM12/8/12
to google-visua...@googlegroups.com
Thanks... yes I'm looking to do something similar here. 

I put together a static version below. This template can only handle one column of data at a time, but I entered the two I want to work with. I only entered the data for two states so far because I'm sure it will have to be changed. I want to look at two datasets, Latino population and Eligible Latino voters, over 4 periods of time: 2000, 2004, 2008 and 2012. 

So there would be two controls, one for year, and one for the data, that would simply repopulate the map with the selected time and dataset.

asgallant

unread,
Dec 8, 2012, 9:55:14 PM12/8/12
to google-visua...@googlegroups.com
Ahh, ok, what you need is a category filter for the year.  The data set is a bit more complicated, but if you like the look of the category filter, I wrote a hack that turns one into a column selector: http://jsfiddle.net/asgallant/WaUu2/

John Gallagher

unread,
Dec 8, 2012, 10:46:56 PM12/8/12
to google-visua...@googlegroups.com
Great… I tried to adapt this to the geomap. I believe I would just have to swap out the code for the bar chart for the code to draw the geomap, but I think it needs additional tweaking. 

Does  it look like I'm on the right track?

http://jsfiddle.net/jayjgal/HU56R/



--
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/-/8Uh4Dn-zTlgJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

asgallant

unread,
Dec 9, 2012, 12:43:07 AM12/9/12
to google-visua...@googlegroups.com
You're on the right track.  There are a small handful of tweaks you needed to make it work for your use case, but they're fairly minor: http://jsfiddle.net/asgallant/HU56R/1/
To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.

John Gallagher

unread,
Dec 9, 2012, 6:01:33 PM12/9/12
to google-visua...@googlegroups.com
Great… I see the changes. I got a basic version of it up and running, using four different columns. Really appreciate the help!




To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.

asgallant

unread,
Dec 9, 2012, 7:38:12 PM12/9/12
to google-visua...@googlegroups.com
Cool.  Adding in the year data is the next step; you'll integrate the chart into a Dashboard object and bind it to a CategoryFilter control that works on the year column (this time you'll be using the control the way it was designed to be used, so you won't have to duplicate the hack).
Reply all
Reply to author
Forward
0 new messages