我是angularjs和谷歌排行榜的新手我现在想做一个饼图我想要跟随:
1- display total components inside the centre of the pie charts.
2- display pieSliceText outer side of the pie slice
Run Code Online (Sandbox Code Playgroud)
怎样才能完成我的示例代码:
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart']}]}"> </script>
<div id="piechart" style="width: 900px; height: 500px;"></div>
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
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 = {
height: 360,
width: 360,
pieHole: 0.5,
showLables: 'true',
pieSliceText: 'value',
pieSliceTextStyle: {
color: 'white',
fontSize:18
},
legend: { …
Run Code Online (Sandbox Code Playgroud)