const chartData = [
{
value: 88,
name: '已评审',
},
{
value: 44,
name: '待评审',
},
]
const colorList = ['#2AC5F5','#CA5E74'];
const sum = chartData.reduce((per, cur) => per + cur.value, 0);
const gap = (1 * sum) / 100
const pieData1 = []
for (let i = 0; i < chartData.length; i++) {
pieData1.push({
...chartData[i],
itemStyle: {
borderWidth: 3,
borderRadius: 0,
borderColor: '#0B1B38',
},
})
}
let option = {
title: [
{
text: this.title,
top:26,
left:30,
textStyle: {
fontSize: '17',
fontWeight: '600',
color: '#FFFFFF',
textAlign: 'center',
},
},
],
graphic:[{
type:"text",
left:this.rateOk.toFixed(0)>9?"39%":this.rateOk.toFixed(0)==100?'20%':'42%',
top:"50%",
style:{
text:this.rateOk.toFixed(0)+'%',
textAlign:"center",
fill:"#fff",
fontSize:20,
fontWeight:700
}
}],
legend: {
icon: 'circle',
bottom: '5%',
align: 'left',
itemGap: 18,
itemWidth: 8,
itemHeight: 8,
selectedMode: false,
itemStyle: {},
selectedMode:false,
textStyle: {
color:'#FFFFFF',
rich: {
name: {
verticalAlign: 'right',
align: 'left',
fontSize: 16,
width: 200,
color: '#D8DDE3',
},
percent: {
padding: [0, 0, 0, 10],
color: '#5db7d3',
fontSize: 16,
},
},
},
// formatter: (name) => {
// const item = chartData.find(i => {
// return i.name === name
// })
// const p = ((item.value / sum) * 100).toFixed(0)
// return '{name|' + name + '}' + '{percent|-个/-%}'
// },
},
grid: {
top: '0%',
left: '0%',
bottom: '0%',
right: '0%',
},
color: colorList,
series: [
{
type: 'pie',
roundCap: true,
radius: ['40%', '58%'],
center: ['50%', '54%'],
hoverAnimation:false,
backgroundStyle:{
color:'rgba(255,0,0,0.1)',
},
label: {
show: true,
formatter: '{c}',
color:'#fff',
position:'outside',
},
labelLine: {
show: true,
length:5,
length2:7,
minTurnAngle:140,
},
data: pieData1,
},
],
}
this.dom8 = echarts.init(this.$refs.dom8)
this.dom8.setOption(option)
环形多个
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...