作者:突然丶丶想你 | 来源:互联网 | 2023-02-04 15:26
我使用下面的代码生成一个柱形图,列中有数字,但我真的希望它们位于条形图的底部,而不是顶部.
这是我的图表的视觉效果:
var data = google.visualization.arrayToDataTable([
['Type', 'Completed', 'Outstanding'],
['Item 1', 75, 25],
['Item 2', 50, 40],
['Item 3', 80, 15]
]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{
calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation"
},
2,
{
calc: "stringify",
sourceColumn: 2,
type: "string",
role: "annotation"
}]);
var optiOns= {
legend: 'none',
height: 270,
chartArea: { 'width': '80%', 'height': '80%' },
bar: { groupWidth: '80%' },
vAxis: {
textPosition: 'none',
gridlines: {
color: 'transparent'
}
},
series: {
0: { color: '#00A887' },
1: { color: '#F6323E' },
}
};
var chart = new google.visualization.ColumnChart(document.getElementById('northPMChart'));
chart.draw(view, options);
任何帮助非常感谢.