在此图像中,可以看到文本中有换行符:
Line wrap active on visualization bar chart
如何防止这种情况? 该图表的代码是:
var data = google.visualization.arrayToDataTable(courseprogressdata);
var options =
{
title: 'Progresso do curso',
chartArea:
{
width: '50%'
},
legend: {
position: 'none'
},
chart:
{
subtitle: 'com valores de 0 a 1'
},
hAxis:
{
minValue: 0,
ticks: [0, 0.2, 0.4, 0.6, 0.8, 1.0],
format: 'percent'
},
bar:
{
groupWidth: "90%"
},
cssClassNames:
{
headerCell: 'googleHeaderCell'
}
};
var chart = new google.visualization.BarChart(document.getElementById('courseprogresschart'));
chart.draw(data, options);
courseprogress是一个包含这些数据的数组:
"[["curso","progresso",{"type":"string","role":"annotation"}],
["PJU",0.7893,"78.93%"],
["Fundgest-GRHN1A",0.1427,"14.27%"],
["asdzxc2",0.0387,"3.87%"]]"
[编辑]我注意到换行只发生在firefox上...
在chrome上,一切正常,请参阅:
Line wrap on chrome are disabled
只是了解更多信息,googleHeaderCell css的内容是:
.googleHeaderCell {}
答案 0 :(得分:0)
您可以使用以下选项......
annotations: {
alwaysOutside: true
}