You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
|
|
|
export function pieOption() {
|
|
|
|
const center = ["50%", "170px"];
|
|
|
|
return {
|
|
|
|
color: ["#1A95FF", "#FFAA00", "#04C790"],
|
|
|
|
/* title: {
|
|
|
|
text: "0",
|
|
|
|
top: 45,
|
|
|
|
left: "center",
|
|
|
|
textStyle: {
|
|
|
|
width: "100%",
|
|
|
|
fontSize: 24,
|
|
|
|
color: "#FFFFFF",
|
|
|
|
fontWeight: 400,
|
|
|
|
},
|
|
|
|
itemGap: 5,
|
|
|
|
// subtext: "总数",
|
|
|
|
// subtextStyle: {
|
|
|
|
// fontSize: 20,
|
|
|
|
// color: "#fff",
|
|
|
|
// fontWeight: 400,
|
|
|
|
// },
|
|
|
|
},*/
|
|
|
|
tooltip: {
|
|
|
|
show: false,
|
|
|
|
},
|
|
|
|
// legend: {
|
|
|
|
// top: 350,
|
|
|
|
// bottom: 0,
|
|
|
|
// itemWidth: 20,
|
|
|
|
// itemHeight: 10,
|
|
|
|
// textStyle: {
|
|
|
|
// color: '#D2E7FF',
|
|
|
|
// fontSize: 16,
|
|
|
|
// lineHeight: 20,
|
|
|
|
// },
|
|
|
|
|
|
|
|
// },
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name: 'Access From',
|
|
|
|
type: 'pie',
|
|
|
|
radius: ['60%', '90%'],
|
|
|
|
avoidLabelOverlap: false,
|
|
|
|
labelLine: {
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
data: [],
|
|
|
|
label: {
|
|
|
|
show: false,
|
|
|
|
position: 'center',
|
|
|
|
formatter: data => {
|
|
|
|
console.log(data.color)
|
|
|
|
return `{c_style|${data.percent.toFixed(0)}%}\n{b_style|${data.name}}`
|
|
|
|
// '{c_style|{d}%}\n{b_style|{b}}'
|
|
|
|
},
|
|
|
|
rich: {
|
|
|
|
b_style: {
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: 400,
|
|
|
|
color: '#A3B9DA'
|
|
|
|
},
|
|
|
|
c_style: {
|
|
|
|
padding: [0, 0, 5, 0],
|
|
|
|
fontSize: 24,
|
|
|
|
fontWeight: 'bold',
|
|
|
|
color: '#fff'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
emphasis: {
|
|
|
|
label: {
|
|
|
|
show: true,
|
|
|
|
fontSize: '14',
|
|
|
|
fontWeight: 'normal'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
/* label: {
|
|
|
|
show: false,
|
|
|
|
position: 'center'
|
|
|
|
},
|
|
|
|
emphasis: {
|
|
|
|
label: {
|
|
|
|
show: true,
|
|
|
|
fontSize: 40,
|
|
|
|
fontWeight: 'bold'
|
|
|
|
}
|
|
|
|
},*/
|
|
|
|
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|