Google 图表消除 space
Google charts eliminate space
是否可以消除每两个柱之间的 space 然后添加 space?
看我的例子:
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);
}
看看下面的fiddle。在代码中,我添加了 options
数组并将 bar
值设置为 99%
。这按照您的要求减少了间距(我相信)。
var options = {
bar: {
groupWidth: "99%"
},
};
chart.draw(data, options);
是否可以消除每两个柱之间的 space 然后添加 space?
看我的例子:
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);
}
看看下面的fiddle。在代码中,我添加了 options
数组并将 bar
值设置为 99%
。这按照您的要求减少了间距(我相信)。
var options = {
bar: {
groupWidth: "99%"
},
};
chart.draw(data, options);