Google图表工具会截断y轴标签 [英] Google Chart Tools truncating y axis labels

查看:143
本文介绍了Google图表工具会截断y轴标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此处使用 Google条形图是我得到的:

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

这是我的自定义选项

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>标签设置宽度吗?

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

推荐答案

我相信您正在寻找chartArea.left选项.尝试这样的操作,并弄乱chartArea.left和chartArea.width值(虽然应该合计为500的总宽度),直到您的y标签全部可见:

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

这篇关于Google图表工具会截断y轴标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆