Sourceinit(dataArr) {
this.myChart.setOption({
title: [ //标题
{
left: 120,
text: '案件来源情况',
textStyle: {
color: '#30e4ff',
fontSize: 23,
fontWeight: 500
}
}
],
tooltip: { //提示信息来源
trigger: 'axis'
},
grid: { //图表距离边框的距离
left: '6%',
right: '6%',
bottom: '6%',
containLabel: true
},
graphic: { //图形中间图片
elements: [
{
type: 'image',
style: {
image: require('./assets/1.png'),
width: 30,
height: 35
},
left: 'center',
bottom: '35%'
}
]
},
color: ['#8e30ff', '#efe73b', '#38f4f2', '#0263ff', '#ff7723'], //图表颜色
series: [
{
name: 'Access From',
type: 'pie',
radius: ['45%', '60%'], //环形 [内圆,外圆 ]
data: dataArr,
center: ['50%', '60%'], // 圆形的位置
label: {
fontSize: 12,
formatter: '{b} {c}' //提示信息文字格式
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
})
},