My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 12: gvisGeoChart: unable to set marker colors for
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Mar 2012


 
Reported by estherw...@gmail.com, Mar 19, 2012
What steps will reproduce the problem?

1. Save attached data to R working directory.
2. Execute:
t4.plot <- gvisGeoChart(t4, locationvar='LatLong', colorvar='partition', sizevar='impression',options=list(height=500,width=800,region='US',dataMode='Markers', colorAxis.values='[1,2,3,4]', colorAxis.colors='[0xD63A3A, 0x0026FF, 0x10C200,0xcFFFF00]'))
plot(t4.plot)

What is the expected output? What do you see instead?

Was hoping to see color 0xD63A3A correspond to 1, 0x0026FF to 2, etc. 

Instead, the options seem to be ignored.   
I also tried emulating the color option for gvisGeoMap:

G <- gvisGeoMap(CityPopularity, locationvar='City' ,numvar='Popularity',options=list(region='US',dataMode='markers',colors='[0xD63A3A, 0x0026FF, 0x10C200,0xcFFFF00]'))
plot(G)

t4.plot <- gvisGeoChart(t4, locationvar='LatLong',colorvar='partition',sizevar='impression',options=list(region='US',dataMode='markers',colors='[0xD63A3A, 0x0026FF, 0x10C200,0xcFFFF00]'))
plot(t4.plot)

But I get "14039610 is not a valid color string" when the plot is rendered. 

What version of the product are you using? On what operating system?

platform       x86_64-apple-darwin9.8.0     
arch           x86_64                       
os             darwin9.8.0                  
system         x86_64, darwin9.8.0          
status                                      
major          2                            
minor          13.0                         
year           2011                         
month          04                           
day            13                           
svn rev        55427                        
language       R                            
version.string R version 2.13.0 (2011-04-13)

googleVis version installed is 0.2.14

Please provide any additional information below.

t4.Rdata
17.4 KB   Download
Mar 19, 2012
Project Member #1 markus.g...@googlemail.com
Your syntax is incorrect. The following example should work for you.

 t4.plot <- gvisGeoChart(t4, locationvar='LatLong', colorvar='partition', sizevar='impression',  
                            options=list(height=500, width=800, 
                                  region='US', dataMode='Markers', 
                                 colorAxis="{values:[1,2,3,4], colors:[\'#D63A3A\', \'#0026FF\', \'#10C200\',\'#FFFF00\']}"))

The vignette of the googleVis package has more details on setting options and the following blog entry provides another example for givsGeoChart:

http://lamages.blogspot.co.uk/2012/03/change-in-life-expectancy-animated-with.html

Status: Accepted
Mar 20, 2012
Project Member #2 markus.g...@googlemail.com
Added additional example to help gvisGeoChart help file and vignette.
Status: Fixed
Oct 22, 2013
#3 rbro...@gmail.com
if using in html use the following. took me a while to figure out, simple mistake i made.

colorAxis:  {
values: [0.2,1.7,10],
colors: ['red','blue','green']}
};
Jun 27, 2014
#4 Inuskmu...@gmail.com
where to put the above code in which function ......color code
Jun 27, 2014
#5 Inuskmu...@gmail.com
i'm using motion chart how to put customize color,please reply,in which function hav to put the color
Jun 27, 2014
Project Member #6 markus.g...@googlemail.com
Unfortunately colours can't be customise in motion charts.

Powered by Google Project Hosting