是否可以消除每两个条之间的空间然后添加空格?
看看我的例子:
google.load('visualization', '1', {packages: ['corechart', 'bar']});
google.setOnLoadCallback(drawBasic);
function drawBasic() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Time of Day');
data.addColumn('number', 'Motivation Level');
data.addRows([
["6/4/2015", 10] ,
["13/4/2015", 10] ,
["7/4/2015", 20] ,
["14/4/2015", 10] ,
["8/4/2015", 10] ,
]);
var chart = new google.visualization.ColumnChart(
document.getElementById('chart_div'));
chart.draw(data, null);
}
答案 0 :(得分:0)
看看以下小提琴。在代码中,我添加了options
数组,并将bar
值设置为99%
。这样可以减少间距(我相信)。
var options = {
bar: {
groupWidth: "99%"
},
};
chart.draw(data, options);