Google Chart Tools截断y轴标签

Jun*_*r M 23 google-visualization truncated axis-labels

使用谷歌条形图,这是我得到的:

在此输入图像描述

这是我的自定义选项

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'} } 
 };
Run Code Online (Sandbox Code Playgroud)

我不能为这些<g>/ <rect>标签设置宽度吗?

小智 43

我相信chartArea.left选项正是您所需要的.尝试这样的事情,并使用chartArea.left和chartArea.width值(尽管你的总宽度应该加起来为500),直到y标签全部可见为止:

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} 
 };
Run Code Online (Sandbox Code Playgroud)