Reputation: 48475
I'm wondering why google charts add a blank padding when not specifying the top/right/left axises.
Select the image and you'll find a huge padding except the bottom which is already filled & that's why, how to remove that?
Specifically, Talking about the right and left paddings.
Thank you.
Upvotes: 14
Views: 26113
Reputation: 4724
You can use the chartArea
option as follows:
options.chartArea = { left: '8%', top: '8%', width: "70%", height: "70%"};
More documentation can be viewed here:
https://developers.google.com/chart/interactive/docs/gallery/piechart#Configuration_Options
Upvotes: 20
Reputation: 61016
When using the Google Chart API you can eliminate the padding. I made an example Here.
The relevant parameter is chma.
According to the documentation:
You can specify the size of the chart's margins, in pixels. Margins are calculated inward from the specified chart size (chs); increasing the margin size does not increase the total chart size, but rather shrinks the chart area, if necessary.
You can try these parameters online in the Chart Playground HERE.
HTH!
Edit: Warning from Google
Upvotes: 3
Reputation: 8826
Unfortunately, as said in Chart Margins documentation you can set only the minimum margin on each side of the chart.
Google adds some unnecessary margin (mostly on top) itself and there is no parameter which can stop this behavior.
Upvotes: 2