Remove padding or margins from Google Charts

Paul Armdam picture Paul Armdam · Mar 12, 2012 · Viewed 122.4k times · Source

Example fiddle

How do I remove padding or margins in this example?

Answer

Eggxactly picture Eggxactly · Mar 12, 2012

By adding and tuning some configuration options listed in the API documentation, you can create a lot of different styles. For instance, here is a version that removes most of the extra blank space by setting the chartArea.width to 100% and chartArea.height to 80% and moving the legend.position to bottom:

// Set chart options
var options = {'title': 'How Much Pizza I Ate Last Night',
               'width': 350,
               'height': 400,
               'chartArea': {'width': '100%', 'height': '80%'},
               'legend': {'position': 'bottom'}
    };

If you want to tune it more, try changing these values or using other properties from the link above.