默认情况下,从右侧到左侧保持水平滚动时,我注意到要删除左侧的空白区域。从右侧向左侧滚动时,问题无法清除左侧显示的空白区域。任何的意见都将会有帮助。css代码删除不必要的空白空间
演示链接: http://jsfiddle.net/3xa69njt/
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Adult', 'Child','Infant', 'Senior'],
['2004', 11, 14, 2, 9],
['2005', 12, 14, 2, 9],
['2004', 13, 14, 2, 9],
['2005', 14, 14, 2, 9],
['2004', 15, 14, 2, 9],
['2005', 11, 14, 2, 9],
['2004', 12, 14, 2, 9],
['2005', 13, 14, 2, 9],
['2004', 14, 14, 2, 9],
['2005', 15, 14, 2, 9],
['2004', 11, 14, 2, 9],
['2005', 12, 14, 2, 9],
['2004', 13, 14, 2, 9],
['2005', 14, 14, 2, 9],
['2004', 15, 14, 2, 9],
['2005', 11, 14, 2, 9],
['2004', 12, 14, 2, 9],
['2005', 13, 14, 2, 9],
['2004', 14, 14, 2, 9],
['2005', 15, 14, 2, 9],
['2004', 11, 14, 2, 9],
['2005', 12, 14, 2, 9],
['2004', 13, 14, 2, 9],
['2005', 14, 14, 2, 9]
]);
var options = {
title: 'Company Performance',
hAxis: {title: 'Year', titleTextStyle: {color: 'red'}},
width: data.getNumberOfRows() * 130,
bar: {groupWidth: 90},
chartArea: {left:60, width:'94%'}
};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
#chart_div {
overflow-x: auto;
overflow-y: hidden;
direction:rtl;
height:500px;
}
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<div id="chart_div"></div>
使用margin-left : 0px;left:0px;
但没有运气尝试。
- 编辑 - 如上所述,我希望滚动条从右向左滚动,这就是使用direction:rtl
的原因。
你真的需要'方向:rtl'? –