【发布时间】:2015-03-06 15:41:13
【问题描述】:
google可视化核心图表中是否可以为图例添加边框?
这里是代码http://jsfiddle.net/mchx2nLe/1/
google.load('visualization', '1', {
packages: ['corechart']
});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.arrayToDataTable([
['Status', 'Completed', 'In Progress', 'Registered / Not Started', 'Past Due', {
role: 'annotation'
}],
['Safety', 100.0, 0.0, 0.0, 0.0, 'Hello'],
['Conduct ', 100.0, 0.0, 0.0, 0.0, 'Hello'],
['Policy', 100.0, 0.0, 0.0, 0.0, 'Hello'],
['Privacy', 100.0, 0.0, 0.0, 0.0, 'Hello'],
['Violence', 100.0, 0.0, 0.0, 0.0, 'Hello'],
['Integrity', 0.0, 0.0, 100.0, 0.0, 'Hello']
]);
var options = {
height: 500,
width: 500,
chartArea: {
left: 100,
top: 100,
right: 0,
bottom: 0
},
hAxis: {
ticks: [25, 50, 75, 100]
},
isStacked: true,
bar: {
groupWidth: '20'
},
vAxis: {
textStyle: {
color: '#000000',
fontSize: '12',
paddingRight: '0',
marginRight: '0'
}
},
colors: ['green', '#ffff99', '#ffbf0c', 'red'],
legend: {
position: 'right'
},
annotations: {
alwaysOutside: true,
highContrast: true,
textStyle: {
fontSize: 17,
auraColor: 'none',
color: '#000'
}
},
};
var chart = new google.visualization.BarChart(
document.getElementById('ex5'));
chart.draw(data, options);
}
要移动右下角的图例并在其周围加边框吗?是否可以?
【问题讨论】:
标签: javascript google-visualization bar-chart