[visualization-api] Geo Map display text instead of numbers

103 views
Skip to first unread message

znac026

unread,
May 2, 2010, 9:25:04 AM5/2/10
to Google Visualization API
Hello,

I have a requirement to display text data (eg. simply yes or no) on a
map. Currently I am using 0 and 1 respectively to respresent no and
yes data. I am trying to use Geo Map for this requirement. But the 3rd
column of the geo map must be a number as I read on the geo map
page. . I am already using the last optional column to store my text
data.

Does anyone have any ideas how i can display only the text instead of
the number?
Can we hide the number column from being displayed?
How can I change the legend to also go from yes to no instead of 0-1

Many thanks if you can help


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
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.

MC Get Vizzy

unread,
May 3, 2010, 7:21:25 AM5/3/10
to google-visua...@googlegroups.com
you can set the formatted value for each cell in the 3rd column, as in:

data.setValue(0, 0, 'RU');
data.setValue(0, 1, 1);
data.setFormattedValue(0, 1, 'yes');

or something like:

for (var i = 0; i < data.getNumberOfRows(); i++) {
  data.setFormattedValue(i, 1, ['no', 'yes'][value]);
}

unfortunately, there is no way to make the legend go from no to yes.  you should probably just hide the legend, with options.showLegend = false
Reply all
Reply to author
Forward
0 new messages