google 条形图中的注释
annotation in google bar chart
我在 google 图表中没有看到注释。
这是代码。
http://jsfiddle.net/sn37vp58/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: 'top' },
annotations: {
alwaysOutside: false,
textStyle: {
fontSize: 17,
auraColor: '#eee',
color: '#eee'
}},
};
var chart = new google.visualization.BarChart(
document.getElementById('ex5'));
chart.draw(data, options);
}
我正在使用 google 可视化条形图来显示条形图,但缺少注释....
将 annotations.alwaysOutside 设置为 true 将使它们显示出来。
See jsfiddle
alwaysOutside: true,
textStyle: {
fontSize: 17,
auraColor: 'none',
color: '#555'
}
我在 google 图表中没有看到注释。 这是代码。
http://jsfiddle.net/sn37vp58/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: 'top' },
annotations: {
alwaysOutside: false,
textStyle: {
fontSize: 17,
auraColor: '#eee',
color: '#eee'
}},
};
var chart = new google.visualization.BarChart(
document.getElementById('ex5'));
chart.draw(data, options);
}
我正在使用 google 可视化条形图来显示条形图,但缺少注释....
将 annotations.alwaysOutside 设置为 true 将使它们显示出来。 See jsfiddle
alwaysOutside: true,
textStyle: {
fontSize: 17,
auraColor: 'none',
color: '#555'
}