Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove the legend from a Google geoChart?

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?

like image 848
climboid Avatar asked Nov 19 '11 01:11

climboid


1 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

like image 156
OldTinfoil Avatar answered Sep 20 '22 09:09

OldTinfoil