Google Chart Tools truncating y axis labels

2019-04-18 01:54发布

Working with a Google bar chart, here is what I got:

enter image description here

Here my custom options

var options = {
    width: 500, height: 240,
    legend : 'none',
    vAxis:{title:'Answers',textStyle:{color: '#005500',fontSize: '12', paddingRight: '100',marginRight: '100'}},
    hAxis: { title: 'Percentage', textStyle: { color: '#005500', fontSize: '12', paddingRight: '100', marginRight: '100'} } 
 };

Can't I set a width for these <g> / <rect> tags?

2条回答
Lonely孤独者°
2楼-- · 2019-04-18 02:17

chartArea width can be set in percentage. chartArea: {width: 50%}. This will leave up to 50% of the total chart width to the left column.

查看更多
Juvenile、少年°
3楼-- · 2019-04-18 02:38

I believe the chartArea.left option is what you are looking for. Try something like this, and mess around with chartArea.left and chartArea.width values (should add up to your total width of 500 though) until your y labels are all visible:

var options = {
    width: 500, height: 240,
    legend : 'none',
    vAxis:{title:'Answers',textStyle:{color: '#005500',fontSize: '12', paddingRight: '100',marginRight: '100'}},
    hAxis: { title: 'Percentage', textStyle: { color: '#005500', fontSize: '12', paddingRight: '100', marginRight: '100'} },
    chartArea: {left:100, width: 400} 
 };
查看更多
登录 后发表回答