負值我有以下代碼:谷歌圖表 - 避免在Y軸
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Year', 'People'],
['2010',0]
]);
// Create and draw the visualization.
new google.visualization.ColumnChart(document.getElementById('visualization')).
draw(data,
{title:"Yearly Coffee Consumption by Country",
width:600, height:400,
hAxis: {title: "Year"},
backgroundColor: 'none'
}
);
}
這給了我下面的圖表
我該怎麼做才能避免顯示在Y軸負值?我已經嘗試加入 vAxis: {minValue:0}
沒有任何運氣。
沒有爲這些圖表的遊樂場/沙箱:Google Charts Playground
現在這個關於o它的手似乎解決了我的問題。謝謝! – slarti42uk
這是正確的答案 –
'viewWindowMode:「explicit」'不再需要,因爲它現在已經被棄用了。 https://developers.google.com/chart/interactive/docs/gallery/linechart#configuration-options – etoxin