| Issue 12: | gvisGeoChart: unable to set marker colors for | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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.
Mar 20, 2012
Added additional example to help gvisGeoChart help file and vignette.
Status:
Fixed
Oct 22, 2013
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
where to put the above code in which function ......color code
Jun 27, 2014
i'm using motion chart how to put customize color,please reply,in which function hav to put the color
Jun 27, 2014
Unfortunately colours can't be customise in motion charts. |
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