I am using the Google charts API. Is there a way to hide the legend for a scatter plot?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can disable the legend by using 'none' as the position:
legend: {position: 'none'}
回答2:
A bit cleaner way is
legend: 'none'
回答3:
In my case I use:
library: {legend:{position:'none'}}
pie_chart @type_values,library: {legend:{position:'none'}}
回答4:
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.