|
@@ -161,7 +161,9 @@ export default {
|
|
|
itemGap: 22,
|
|
itemGap: 22,
|
|
|
textStyle: { color: '#a8cce8', fontSize: 22 },
|
|
textStyle: { color: '#a8cce8', fontSize: 22 },
|
|
|
formatter: function(name) {
|
|
formatter: function(name) {
|
|
|
- return name + ' ' + countMap[name] + '台'
|
|
|
|
|
|
|
+ const total = Object.values(countMap).reduce((a, b) => a + b, 0) || 1
|
|
|
|
|
+ const pct = Math.round(countMap[name] / total * 100)
|
|
|
|
|
+ return name + ' ' + countMap[name] + '台 ' + pct + '%'
|
|
|
},
|
|
},
|
|
|
rich: {
|
|
rich: {
|
|
|
nm: { fontSize: 22, color: '#a8cce8', width: 90 },
|
|
nm: { fontSize: 22, color: '#a8cce8', width: 90 },
|
|
@@ -184,8 +186,8 @@ export default {
|
|
|
color: '#a8cce8'
|
|
color: '#a8cce8'
|
|
|
},
|
|
},
|
|
|
labelLine: {
|
|
labelLine: {
|
|
|
- length: 10,
|
|
|
|
|
- length2: 10,
|
|
|
|
|
|
|
+ length: 20,
|
|
|
|
|
+ length2: 40,
|
|
|
lineStyle: { color: 'rgba(30,144,255,0.4)', width: 2 }
|
|
lineStyle: { color: 'rgba(30,144,255,0.4)', width: 2 }
|
|
|
},
|
|
},
|
|
|
data: ringData,
|
|
data: ringData,
|
|
@@ -231,8 +233,8 @@ export default {
|
|
|
series: [{
|
|
series: [{
|
|
|
type: 'pie', radius: ['36%', '62%'], center: ['38%', '52%'],
|
|
type: 'pie', radius: ['36%', '62%'], center: ['38%', '52%'],
|
|
|
itemStyle: { borderRadius: 5, borderColor: 'rgba(3,14,31,0.5)', borderWidth: 2 },
|
|
itemStyle: { borderRadius: 5, borderColor: 'rgba(3,14,31,0.5)', borderWidth: 2 },
|
|
|
- label: { show: true, formatter: '{b}\n{c}台', fontSize: 20, color: '#a8cce8', lineHeight: 30 },
|
|
|
|
|
- labelLine: { length: 24, length2: 40, lineStyle: { color: 'rgba(30,144,255,0.4)', width: 2 } },
|
|
|
|
|
|
|
+ label: { show: true, formatter: params => `${params.name}\n${params.value}台\n${params.percent}%`, fontSize: 20, color: '#a8cce8', lineHeight: 30 },
|
|
|
|
|
+ labelLine: { length: 30, length2: 50, lineStyle: { color: 'rgba(30,144,255,0.4)', width: 2 } },
|
|
|
data: pieData,
|
|
data: pieData,
|
|
|
emphasis: { scale: true, scaleSize: 6, itemStyle: { shadowBlur: 25, shadowColor: 'rgba(30,144,255,0.6)' } }
|
|
emphasis: { scale: true, scaleSize: 6, itemStyle: { shadowBlur: 25, shadowColor: 'rgba(30,144,255,0.6)' } }
|
|
|
}]
|
|
}]
|