How to remove padding or margins from Google Charts and JavaScript?

Sometimes, we want to remove padding or margins from Google Charts and JavaScript.

In this article, we’ll look at how to remove padding or margins from Google Charts and JavaScript.

How to remove padding or margins from Google Charts and JavaScript?

To remove padding or margins from Google Charts and JavaScript, we can set the width and height options.

For instance, we write

const options = {
  title: "How Much I Ate Last Night",
  width: 350,
  height: 400,
  chartArea: { width: "100%", height: "80%" },
  legend: { position: "bottom" },
};

to set the width and height in pixels.

And then we set the chartArea to fill 100% of the width and height to remove the margins and padding.

Conclusion

To remove padding or margins from Google Charts and JavaScript, we can set the width and height options.