25

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

在此处输入图像描述

这是我的自定义选项

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'} } 
 };

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

4

2 回答 2

45

我相信 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} 
 };
于 2012-04-20T16:18:50.077 回答
2

chartArea 宽度可以设置为百分比。图表区域:{宽度:50%}。这将在左列留下多达 50% 的总图表宽度。

于 2012-11-07T23:05:44.123 回答