|
@ -1,5 +1,5 @@ |
|
|
|
|
|
|
|
|
export function pieOption () { |
|
|
export function pieOption (_charts) { |
|
|
const center= ['50%', '250px'] |
|
|
const center= ['50%', '250px'] |
|
|
return { |
|
|
return { |
|
|
title: { |
|
|
title: { |
|
@ -47,25 +47,19 @@ const center= ['50%', '250px'] |
|
|
center: center, |
|
|
center: center, |
|
|
radius: ['55%', '55.3%'], |
|
|
radius: ['55%', '55.3%'], |
|
|
label: { |
|
|
label: { |
|
|
normal: { |
|
|
show: false |
|
|
show: false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
labelLine: { |
|
|
labelLine: { |
|
|
normal: { |
|
|
show: false |
|
|
show: false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
data: [{ |
|
|
data: [{ |
|
|
value: 360, |
|
|
value: 360, |
|
|
itemStyle: { |
|
|
itemStyle: { |
|
|
normal: { |
|
|
color: 'rgba(40, 101, 250, 0)', |
|
|
color: 'rgba(40, 101, 250, 0)', |
|
|
width:0, |
|
|
width:0, |
|
|
borderColor: 'rgba(40, 101, 250, 0.5)', |
|
|
borderColor: 'rgba(40, 101, 250, 0.5)', |
|
|
borderWidth: 1, |
|
|
borderWidth: 1, |
|
|
borderType: 'dotted' |
|
|
borderType: 'dotted' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
@ -85,33 +79,55 @@ const center= ['50%', '250px'] |
|
|
left: 'center', |
|
|
left: 'center', |
|
|
width: 400, |
|
|
width: 400, |
|
|
label: { |
|
|
label: { |
|
|
position: 'outer', |
|
|
// show: false,
|
|
|
// alignTo: 'edge',
|
|
|
position: 'outside', |
|
|
formatter: '{a|{c}}\n\n{name|{b}}', |
|
|
alignTo: 'edge', |
|
|
// minMargin: 100,
|
|
|
// formatter: '{a|{c}}\n\n{name|{b}}',
|
|
|
// edgeDistance: 0,
|
|
|
formatter: '{a|{c}}\n{r|}\n{name|{b}}', |
|
|
// lineHeight: 20,
|
|
|
minMargin: 5, |
|
|
|
|
|
edgeDistance: 1, |
|
|
|
|
|
lineHeight: 15, |
|
|
color: '#fff', |
|
|
color: '#fff', |
|
|
fontSize: 12, |
|
|
fontSize: 12, |
|
|
distanceToLabelLine: -60, |
|
|
// distanceToLabelLine: -60,
|
|
|
rich: { |
|
|
rich: { |
|
|
|
|
|
name: { |
|
|
|
|
|
padding: [0, 6, 0, 6] |
|
|
|
|
|
}, |
|
|
a: { |
|
|
a: { |
|
|
fontSize: '30px', |
|
|
fontSize: 30, |
|
|
color: ' #00F5FE', |
|
|
color: '#fff', |
|
|
|
|
|
padding: [0, 6, 6, 6] |
|
|
}, |
|
|
}, |
|
|
b: { |
|
|
r: { |
|
|
lineHeight: 0, |
|
|
backgroundColor: 'auto', |
|
|
fontSize: '20px', |
|
|
borderRadius: 6, |
|
|
color: ' #FFFFFF' |
|
|
width: 6, |
|
|
|
|
|
height: 6, |
|
|
|
|
|
// padding: [3, 3, 0, -12]
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
labelLine: { |
|
|
labelLine: { |
|
|
|
|
|
show: false, |
|
|
smooth: 0.2, |
|
|
smooth: 0.2, |
|
|
length: 30, |
|
|
length: 30, |
|
|
length2: 90 |
|
|
length2: 0, |
|
|
|
|
|
maxSurfaceAngle: 80 |
|
|
|
|
|
}, |
|
|
|
|
|
labelLayout: function (params) { |
|
|
|
|
|
const isLeft = params.labelRect.x < _charts.getWidth() / 2; |
|
|
|
|
|
const points = params.labelLinePoints; |
|
|
|
|
|
// Update the end point.
|
|
|
|
|
|
if (points) { |
|
|
|
|
|
points[2][0] = isLeft |
|
|
|
|
|
? params.labelRect.x |
|
|
|
|
|
: params.labelRect.x + params.labelRect.width; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
labelLinePoints: points |
|
|
|
|
|
}; |
|
|
}, |
|
|
}, |
|
|
// itemStyle: {
|
|
|
// itemStyle: {
|
|
|
// normal:{
|
|
|
// normal:{
|
|
|