Geochart with fixed colors

87 views
Skip to first unread message

Mario Ruiz Sánchez

unread,
Dec 7, 2011, 10:57:24 AM12/7/11
to google-visua...@googlegroups.com
Hi,

I want to use the geochart visualization to show all countries with the most common spoken language, something like:
Spain: Spanish
US: English
France: French
Argentina: Spanish
...

Then I assign every language with a color:
Spanish: red
English: blue
French: gray
other: black

Is it possible?

Thank you.
Any idea 

asgallant

unread,
Dec 7, 2011, 11:53:01 AM12/7/11
to google-visua...@googlegroups.com
Create an array of colors, then assign each language to an integer corresponding to the index of the color you want to match it to.  When building the DataTable, use this value in the language column, and set the formatted value of the cell to the language name; see: http://jsfiddle.net/yCHPx/

Mario Ruiz Sánchez

unread,
Dec 8, 2011, 6:53:57 AM12/8/11
to google-visua...@googlegroups.com
Thanks a lot!!!! :) 
Reply all
Reply to author
Forward
0 new messages