3D餅圖的pieRadius和startingAngle屬性javascript
pieRadius:餅圖的半徑java
startingAngle:餅圖的角度(旋轉)json
在固定大小的div裏面,餅圖上若是顯示label或者value,則餅圖的大小會根據label或者value的長度自動伸縮,此時用屬性pieRadius(餅的半徑)設置爲固定大小, 還能夠用屬性startingAngle控制餅圖初始化的角度。code
實例:orm
var data = [{"color": "429EAD","label": "未啓動","value": 28},{"color": "4249AD","label": "已啓動","value": 66}]; //調用 paintPie3D($("#divName"), 210, 220, data);ip
function paintPie3D(div, width, height, data) { var angle = -100;<pre name="code" class="javascript"> //當數據只有兩個時,控制餅圖的角度 if(data!=null && data.length == 2 && (data[0].value > 0 || data[1].value > 0)){ angle = 80 - (Math.round(data[0].value*180/(data[0].value+data[1].value))); } div.insertFusionCharts({ type: "Pie3D", width: width, height: height, dataFormat: "json", dataSource: { "chart": { "showlegend": "1",//是否顯示圖例 "formatnumberscale": "0", "showlabels": "0", "showvalues": "1", "pieRadius": "56", "startingAngle": angle, "showPercentInToolTip": "1", "showPercentValues": "0" }, "data": data } }) }io