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.
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.
Set the option legend to none. This hides the legend/colorAxis displayed at the left bottom corner of the chart.
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'}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With