我正在尝试使用谷歌图表制作柱形图。
function drawChartEPS(response) {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Period');
data.addColumn('number', 'Q1');
data.addColumn({type: 'string', role: 'style'});
data.addColumn({type:'string', role: 'annotation'}, '');
data.addColumn('number', 'Q2');
data.addColumn({type: 'string', role: 'style'});
data.addColumn({type:'string', role: 'annotation'}, '');
data.addColumn('number', 'Q3');
data.addColumn({type: 'string', role: 'style'});
data.addColumn({type:'string', role: 'annotation'}, '');
data.addColumn('number', 'Q4');
data.addColumn({type: 'string', role: 'style'});
data.addColumn({type:'string', role: 'annotation'}, '');
data.addRows(response);
var options = {
width: '100%',
height: '80%',
bar: {groupWidth: "90%", width: "100%", gap: "30%"},
chartArea:{width:"100%",height:"100%"},
annotations: {
highContrast: true,
style: 'point',
textStyle: {
fontName: 'Sans',
fontSize: 16,
bold: false,
italic: false,
direction:-1,
slantedText:true,
slantedTextAngle:90,
opacity: 1
}
},
legend: {
position: 'none'
}
};
var chart = new google.visualization.ColumnChart(
document.getElementById('EPSChart'));
chart.draw(data, options);
}
并得到结果 谷歌图表
但我需要我的图表看起来像这张图片示例 不能更改图表上文本的方向并添加箭头