Thanks a bunch. I think I can make that work! On Wednesday, August 26, 2015 at 8:44:53 AM UTC-5, Sergey wrote: > > Hi David, > > I'm not really sure what gvisGeoMap does, since it's not officially > supported by Google, but here's an example of how you can do it in > JavaScript: http://jsfiddle.net/LLknt4cc/1/ > > On Tue, Aug 25, 2015 at 5:42 PM David Zornek <[email protected] > <javascript:>> wrote: > >> I am attempting to create a map in which each US state is colored >> according to a character type categorical variable. I am able to get the >> map to render, but all of the tooltips show a numeric value instead of the >> character string in my variable. Here's a reproducible example: >> >> library(googleVis) >> library(datasets) >> >> >> category <- c("A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E", >> "A","B","C","D","E") >> >> hover <- c(1:50) >> >> data <- data.frame(state.name,category,hover) >> >> Map <- gvisGeoMap(data, "state.name", "category", "hover", >> options=list(region="US", >> displayMode="regions", >> resolution="provinces", >> width=600, height=400)) >> plot(Map) >> >> The map assigns colors correctly for "category," but the tooltip shows >> category as a number, rather than a letter A - E. Ultimately, I would like >> to be able to assign discrete colors to each category, rather than using a >> gradient, but I'll take one step at a time with my questions. The end goal >> is to use this map in a Shiny app. Any help is much appreciated. >> >> >> P.S. I've tried gvisGeoChart with essentially the same result. Simply >> assigning hover = category doesn't work in my situation; in the final >> product, I will be displaying a separate hover variable in the tool tip. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Visualization API" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at >> http://groups.google.com/group/google-visualization-api. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-visualization-api/7b21882e-f786-41c5-9da4-f1293ea175b0%40googlegroups.com >> >> <https://groups.google.com/d/msgid/google-visualization-api/7b21882e-f786-41c5-9da4-f1293ea175b0%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> >
-- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/3c6fbe10-8308-4b04-9fc4-3c86aff55d18%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
