Skip to content
Drempd Logo
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • projects
    • website design
    • code notes
  • contact
Blog Web Dev Removing the Horizontal Margins on a Google Chart Graph

Removing the Horizontal Margins on a Google Chart Graph

By Forrest Smith - Drempd.com

I seem to be able to successfully modify quite a bit with google charts, but I couldn’t find a good way to remove the horizontal padding to the left and right of a google graph.  From what I can find, there really isn’t a good way to do it.  I thought I was close with some of the answers on this page, but nothing seemed to work.  

In the end, I ended up using css to do it, but creating a wrapper div around the chart div, expanding the width of the chart div, setting a negative margin, and an overflow hidden on the wrapper div to hide the padding that gets applied.  Something like:

#graph-wrapper{
   overflow: hidden;
   width: 100%;
}
#graph{
   height: 25%;
   width: 122%;
   margin-left: -11%;
}

I can’t say this is a super-elegant answer to the issue, but it seems to work ok (I had to play around with the width and margin on the #graph).

Posted on May 14, 2016August 26, 2022 in Web Dev

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I love to create and explore. Whether building a website or app, taking a long walk through the mountains, or playing with a random idea, I've found that there will never be enough time to experience it all. But that won't stop me from trying.

Web Design & Development

  • Portfolio
  • San Diego Website Design
  • Custom Web Design
  • Responsive Web Design
  • Website Maintenance
  • Freelance Web Designer
  • Web Design Posts
  • Website Checklist

Projects

  • Zindash
  • Opti
  • Saphire CSS
  • Ergo Blocks

Blog

  • Adventure
  • San Diego
  • Projects
  • Website Design
  • Technology
  • Code Notes

About

  • Bluesky
  • Resume
  • Contact
drempd | san diego, ca
© 2026 Drempd All rights reserved.