Skip to content

Commit 5e3edcd

Browse files
committed
temp fix chart ui
1 parent 065b27f commit 5e3edcd

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

scripts/chart/chart-core.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,11 @@ function donutChart() {
9090
pos[0] = radius * 0.95 * (midAngle(d) < Math.PI ? 1 : -1);
9191

9292
var currentAngle = midAngle(d);
93-
if (angleIsInRangeDifference(tempAngle, currentAngle, 2)){
93+
if (angleIsInRangeDifference(tempAngle, currentAngle, 0.5)){
9494
tempOffset.x -= 0.07;
9595
tempOffset.y += 0.07;
9696
tempAngle = 0;
97-
}
9897

99-
if (d.data.percentage < 0.10 || d.data.url == 'Others' ){
10098
pos[0] = pos[0] * tempOffset.x;
10199
pos[1] = pos[1] * tempOffset.y;
102100
}
@@ -127,15 +125,13 @@ function donutChart() {
127125
pos[0] = radius * 0.95 * (midAngle(d) < Math.PI ? 1 : -1);
128126

129127
var currentAngle = midAngle(d);
130-
if (angleIsInRangeDifference(tempAngle, currentAngle, 2)){
128+
if (angleIsInRangeDifference(tempAngle, currentAngle, 0.5)){
131129
tempOffset.x -= 0.07;
132130
tempOffset.y += 0.07;
133-
tempAngle = 0;
134-
}
135131

136-
if (d.data.percentage < 0.10 || d.data.url == 'Others'){
137132
pos[0] = pos[0] * tempOffset.x;
138133
pos[1] = pos[1] * tempOffset.y;
134+
tempAngle = 0;
139135
}
140136

141137
tempAngle = midAngle(d);

0 commit comments

Comments
 (0)