默認情況下,從右側到左側保持水平滾動時,我注意到要刪除左側的空白區域。從右側向左側滾動時,問題無法清除左側顯示的空白區域。任何的意見都將會有幫助。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'? –