[英]Google Pie Charts Label
http://j1309.hizliresim.com/1f/v/t1ux0.png http://j1309.hizliresim.com/1f/v/t1ux0.png
Thats my chart and my code; 这是我的图表和我的代码;
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities'
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
how can i make my labels like that picture. 我怎样才能使我的标签像那张照片。 i want it shows values outside of chart
我希望它显示图表之外的值
http://o1309.hizliresim.com/1f/v/t1uy7.png http://o1309.hizliresim.com/1f/v/t1uy7.png
Use in your options: 在您的选项中使用:
var options = {
title: 'My Daily Activities',
legend: {position: 'labeled'}
};
More Information here: https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart 更多信息: https : //google-developers.appspot.com/chart/interactive/docs/gallery/piechart
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.