我有以下代码:
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'
}
);
}
这给了我下面的图表
如何避免在 yAxis 中显示负值?我试过添加
vAxis: {minValue:0}
没有任何运气。
这些图表有一个游乐场/沙箱:Google Charts Playground
</p>