How do I remove the legend that appears in the bottom of the Google geoChart? I know that if I don't pass data.setValue to the chart object it wont show, but I need them to populate the map. All I want to do is get rid of the colors. Any ideas?
-
"How do I remove the legend" yes the legend that shows in the bottom left of the google svg world map chart – climboid Nov 19 '11 at 23:22
3 Answers
See : http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html#Configuration_Options
"An object with members to configure various aspects of the legend, or 'none', if no legend should appear."
So basically, when you're passing your configuration options into the API, you want to include the following:
legend: 'none'
A simple example set of chart options would be:
var options = {
displayMode: 'markers',
colorAxis: {colors: ['green', 'blue']},
legend: 'none',
}
The modified version of the marker example provided by google on: http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html#Examples

- 1,495
- 1
- 14
- 25

- 1,187
- 19
- 32
-
Hey IntreipdBrit, thanks for the comment. Do you know if this was just added or has it always been there? – climboid Mar 01 '12 at 15:48
-
-
It doesn't work for me...this: http://stackoverflow.com/questions/5202029/hiding-the-legend-in-google-chart works instead – Alberto Fontana Sep 16 '15 at 14:26
Set the option legend to none.
legend: 'none'
This hides the legend/colorAxis displayed at the left bottom corner of the chart.

- 109
- 1
- 4
So apparently there isn't a way to do this. If you are using google geoMap wich renders a Flash object then there is a simple property you set to false in the geoMap object to not render the legend on the bottom left. I did how ever using jQuery manage to remove it but that just doesn't flow nicely given that it has to exist in the DOM before you can remove it. If you are seeking to use a world map I strongly recommend jVecotor Map. It renders exactly the same in old IE browsers and has less vectors in the map so it is faster to load since the DOM is not over saturated.

- 6,932
- 14
- 44
- 71