How to hide the legend in Google Chart with JavaScript?

Sometimes, we want to hide the legend in Google Chart with JavaScript

In this article, we’ll look at how to hide the legend in Google Chart with JavaScript.

How to hide the legend in Google Chart with JavaScript?

To hide the legend in Google Chart with JavaScript, we set the legend property to 'none'.

For instance, we write

const options = {
  //...
  legend: "none",
};

to set legend to 'none' in the options object to hide the legend.

Conclusion

To hide the legend in Google Chart with JavaScript, we set the legend property to 'none'.