Here's the solution: http://jsfiddle.net/hsakX/
Set the bar.groupWidth option to fix the width of the bars. Then make the width of the chart a function of the bar-width and the number of bars to be displayed:
var options = {
title: 'Company Performance',
hAxis: {title: 'Year', titleTextStyle: {color: 'red'}},
width: data.getNumberOfRows() * 65,
bar: {groupWidth: 20}
};
Set the overflow-x on the containing div to scroll:
#chart_div {
overflow-x: scroll;
overflow-y: hidden;
width: 500px;
height: 550px;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…