Creating a GeoChart Map with Cities

4,277 views
Skip to first unread message

Don Doyle

unread,
Nov 21, 2013, 9:34:29 AM11/21/13
to google-visua...@googlegroups.com
I am a historian and a complete novice to this realm. I want a Geo Chart or Map that will show the global dispersion of letters of condolence following Abraham Lincoln's death in 1865.
My data include:
country, city, date, type of group, and I may want to add some kind of content variable indicating political sentiment
I want the map to show a marker, a small round dot, for each of about 500 letters from all part of the world. 
I see the GeoChart template with markers indicating variables for countries. 
How do I use city level data tp visualize the dispersion of these letters? 
Many thanks for whatever help you can provide.
  --Don

asgallant

unread,
Nov 21, 2013, 10:11:29 AM11/21/13
to google-visua...@googlegroups.com
The GeoChart allows you to chart up to two numerical values per data point in markers mode (one determines the color of the point, one determines the size of the point).  If you want to add additional data (like dates), you have to add them in to the formatted value of the one of the other columns.

Example with the dates added to the locations: http://jsfiddle.net/asgallant/rHqa2/
Example with the dates replacing the "size" value: http://jsfiddle.net/asgallant/rHqa2/1/

Don Doyle

unread,
Nov 22, 2013, 8:41:10 AM11/22/13
to google-visua...@googlegroups.com
Thanks much asgallant. 
In your first example, the dates are viewable when the cursor is over the data point. 
It seems like the size of the data point I would want fixed, making each letter equal in size that is.
The color spectrum could be used to indicate either date or political sentiment, I suppose: red for socialist, blue for royalist and shades of each for in between, for example.
So, using your model, I would prepare my data in columns using the format or encryption (I'm a novice as I said!) you show on the sample and insert that data where you have the sample data.
Where is the best place for a novice to build such a Geochart?  Do I use the Google Code Playground site: https://code.google.com/apis/ajax/playground/?type=visualization#geo_chart 

Another, perhaps more complicated question: is it possible to embed links to each data point that would take a viewer from the data point to the actual letter in question? 

many thanks for your help.

asgallant

unread,
Nov 22, 2013, 11:04:52 AM11/22/13
to google-visua...@googlegroups.com
You can't create links directly, but you can store URL's in the DataTable and reference them based on what the user clicks in the table.  You can then navigate to the URL by setting window.location or open it in a new window/tab by calling window.open.  Here's an updated example with URL's opening in a new window/tab: http://jsfiddle.net/asgallant/rHqa2/2/

You can work in the playground if you want, or in jsfiddle, or create an HTML file and work locally on your PC.  jsfiddle has the advantage of creating versions of your code as you work (when you click the "update" button, jsfiddle saves your work and increments the version number (the "/2/" at the end of the URL I posted above), so you can go back to earlier versions if you mess up your code or decide you'd rather go down a different path).
Reply all
Reply to author
Forward
0 new messages