简体   繁体   中英

Hiding the legend in Google Chart

I am using the Google charts API. Is there a way to hide the legend for a scatter plot?

您可以使用'none'作为位置来禁用图例:

legend: {position: 'none'}

有点清洁的方式

legend: 'none'

In my case I use:

library: {legend:{position:'none'}}

pie_chart @type_values, library: {legend:{position:'none'}}

var options = {
               title: 'USA City Distribution',
               legend: 'none'
              };

In drawChart() function, Add legend: none property in your chart options object

It doesn't appear so from the API, you can only set a position, with no option for "none". You could probably remove it with javascript though, if you can identify the containing element.

Edit: it actually appears as though you can omit the chdl= parameter to get a scatter without a legend.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM