|
@@ -82,10 +82,13 @@
|
|
// 第二个职业
|
|
// 第二个职业
|
|
else if(sum < Math.pow(300,2) && sum > Math.pow(250,2)){
|
|
else if(sum < Math.pow(300,2) && sum > Math.pow(250,2)){
|
|
startAngle21 = calcAngle();
|
|
startAngle21 = calcAngle();
|
|
|
|
+ calcPaintCircleFlag(3)
|
|
}else if(sum < Math.pow(350,2) && sum > Math.pow(300,2)){
|
|
}else if(sum < Math.pow(350,2) && sum > Math.pow(300,2)){
|
|
startAngle22 = calcAngle();
|
|
startAngle22 = calcAngle();
|
|
|
|
+ calcPaintCircleFlag(4)
|
|
}else if(sum < Math.pow(400,2) && sum > Math.pow(350,2)){
|
|
}else if(sum < Math.pow(400,2) && sum > Math.pow(350,2)){
|
|
startAngle23 = calcAngle();
|
|
startAngle23 = calcAngle();
|
|
|
|
+ calcPaintCircleFlag(5)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -124,11 +127,17 @@
|
|
}
|
|
}
|
|
// 第二个职业
|
|
// 第二个职业
|
|
else if(sum < Math.pow(300,2) && sum > Math.pow(250,2)){
|
|
else if(sum < Math.pow(300,2) && sum > Math.pow(250,2)){
|
|
- paint("#ffd309", 275, startAngle21 ,ret);
|
|
|
|
|
|
+ if(paintFlagList[3]){
|
|
|
|
+ paint("#ffd309", 275, startAngle21 ,ret);
|
|
|
|
+ }
|
|
}else if(sum < Math.pow(350,2) && sum > Math.pow(300,2)){
|
|
}else if(sum < Math.pow(350,2) && sum > Math.pow(300,2)){
|
|
- paint("#ffd309", 325, startAngle22 ,ret);
|
|
|
|
|
|
+ if(paintFlagList[4]){
|
|
|
|
+ paint("#ffd309", 325, startAngle22 ,ret);
|
|
|
|
+ }
|
|
}else if(sum < Math.pow(400,2) && sum > Math.pow(350,2)){
|
|
}else if(sum < Math.pow(400,2) && sum > Math.pow(350,2)){
|
|
- paint("#ffd309", 375, startAngle23 ,ret);
|
|
|
|
|
|
+ if(paintFlagList[5]){
|
|
|
|
+ paint("#ffd309", 375, startAngle23 ,ret);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -143,7 +152,7 @@
|
|
ret += 450;
|
|
ret += 450;
|
|
}
|
|
}
|
|
let num = ret * Math.PI/180 +Math.PI;
|
|
let num = ret * Math.PI/180 +Math.PI;
|
|
- // console.log('角度:'+num);
|
|
|
|
|
|
+ console.log('角度:'+num);
|
|
return num;
|
|
return num;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -164,6 +173,10 @@
|
|
|
|
|
|
|
|
|
|
function paint(color, radius, startAngle, endAngle){
|
|
function paint(color, radius, startAngle, endAngle){
|
|
|
|
+ // 结束角度不能小于起始角度
|
|
|
|
+ if(endAngle <= startAngle){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
context.lineWidth = 50;
|
|
context.lineWidth = 50;
|
|
context.strokeStyle = color;
|
|
context.strokeStyle = color;
|
|
context.beginPath();
|
|
context.beginPath();
|