Stu*_*Cat 5 javascript google-visualization
因此,我尝试弄乱我的图表,发现整数/浮点数/日期在x轴上可以很好地工作,但是在您输入字符串时,它会爆炸。
我正在尝试绘制a:字/计数图,但不幸的是,我似乎无法将字符串放在x轴上。Google Charts允许使用此格式吗?还是严格按照int / floats / dates格式输入?
使用 vAxis 和 hAxis 属性如下
google.visualization.ColumnChart(document.getElementById('visualization')).
draw(data,
{title:"Yearly Coffee Consumption by Country",
width:600, height:400,
vAxis: {title: "Year",ticks: [{v:100, f:"100$"},{v:150, f:"150$"},{v:200, f:"200$"},{v:300, f:"300$"}]},
hAxis: {title: "Cups",ticks: [{v:4, f:"3-4"},{v:8, f:"5-9"},{v:10, f:"9-13"},{v:14, f:"13-14"},{v:20, f:"15-20"}]} }
);
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请检查此How to get the vaxis line in columns of google api Chart?
| 归档时间: |
|
| 查看次数: |
4577 次 |
| 最近记录: |