Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding the legend in Google Chart

People also ask

How do I hide the legend in my Google chart?

The Legend is hidden by setting the legend property to none in the Google Chart Options. title: 'USA City Distribution', legend: 'none' // Hides the Legend.

How do you hide the legend?

To hide the legend, click None. Tip: To quickly remove a legend or a legend entry from a chart, you can select it, and then press DELETE. You can also right-click the legend or a legend entry, and then click Delete. To display a legend, click the display option that you want.

How do I remove the legend Geo chart in Google Sheets?

Set the option legend to none. This hides the legend/colorAxis displayed at the left bottom corner of the chart.

How do I hide the legend in a line graph?

According to the official documentation (https://www.chartjs.org/docs/latest/configuration/legend.html), to hide the legend, the display property of the options. display object must be set to false .


You can disable the legend by using 'none' as the position:

legend: {position: 'none'}


A bit cleaner way is

legend: 'none'

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

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


In my case I use:

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

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