tush1r / google-motion-charts-with-r

Automatically exported from code.google.com/p/google-motion-charts-with-r
0 stars 0 forks source link

gvisGeoChart: unable to set marker colors for #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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='Mar
kers', 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='[0xD63A
3A, 0x0026FF, 0x10C200,0xcFFFF00]'))
plot(G)

t4.plot <- gvisGeoChart(t4, 
locationvar='LatLong',colorvar='partition',sizevar='impression',options=list(reg
ion='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.

Original issue reported on code.google.com by estherw...@gmail.com on 19 Mar 2012 at 6:23

Attachments:

GoogleCodeExporter commented 9 years ago
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.ht
ml

Original comment by markus.g...@googlemail.com on 19 Mar 2012 at 7:08

GoogleCodeExporter commented 9 years ago
Added additional example to help gvisGeoChart help file and vignette.

Original comment by markus.g...@googlemail.com on 20 Mar 2012 at 9:53

GoogleCodeExporter commented 9 years ago
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']}
};

Original comment by rbro...@gmail.com on 22 Oct 2013 at 5:47

GoogleCodeExporter commented 9 years ago
where to put the above code in which function ......color code

Original comment by Inuskmu...@gmail.com on 27 Jun 2014 at 2:38

GoogleCodeExporter commented 9 years ago
i'm using motion chart how to put customize color,please reply,in which 
function hav to put the color

Original comment by Inuskmu...@gmail.com on 27 Jun 2014 at 2:42

GoogleCodeExporter commented 9 years ago
Unfortunately colours can't be customise in motion charts.

Original comment by markus.g...@googlemail.com on 27 Jun 2014 at 5:51