2018年1月3日
遇到一个问题 $scope.data={};
只要是方法体{}内才有效。以外无效 // 环形图
Services.getData('user/accountDetail.html',$scope.accountSend, function(data) {
$scope.accountDetail = data.data;
$scope.moneyTenderFreeze = $scope.accountDetail.moneyTenderFreeze;
$scope.XXX= $scope.accountDetail.XXX;
$scope.moneyUsable = $scope.accountDetail.moneyUsable;
sessionStorage.moneyUsable = $scope.accountDetail.moneyUsable;
sessionStorage.banckName = $scope.accountDetail.bank;
sessionStorage.bankCard = $scope.accountDetail.bankCard;
// 环形图
var ctx = document.getElementById("myChart").getContext("2d");
$scope.doughnutdata = [
{
value: $scope.moneyTenderFreeze,
color:"#FEAA35"
},
{
value : $scope.yonglibao,
color : "#17B6F9"
},
{
value : $scope.moneyUsable,
color : "#00F889"
}
]
var options = {
segmentShowStroke : false,
segmentStrokeColor : "#fff",
segmentStrokeWidth : 0,
percentageInnerCutout : 35,
animation : false,
animationSteps : 100,
animationEasing : "easeOutBounce",
animateRotate : true,
animateScale : false,
onAnimationComplete : null
}
new Chart(ctx).Doughnut($scope.doughnutdata,options);
})
网友评论