代码拉取完成,页面将自动刷新
(function(){
var dom =$('[data-label=clue_orgin]').get(0);
var myChart = echarts.init(dom);
var channel = ["广告","招投网","电话营销数据库","邮件营销列表","社交媒体平台","行业展会","线下峰会及研讨会","网页表单提交","合作伙伴推荐","客户转介绍","市场调研数据","公开信息","专业行业数据库","电子邮件营销中的回复与咨询","商业目录及黄页"];
var data = [];
for(var i=0;i<channel.length;i++){
var value = parseInt(Math.random() * 3004);
var name = channel[i]
data.push({
value:value,
name:name
})
}
data.sort(function(a,b){
return b.value -a.value
})
option = {
legend: {
top: 'bottom'
},
grid: {
top: '1%',
bottom: '20%'
},
series: [
{
name: 'clue_orgin',
type: 'pie',
radius: [40, 250],
center: ['50%', '45%'],
roseType: 'area',
itemStyle: {
borderRadius: 10
},
label: {
formatter: '{name|{b}}\n{time|{c}}',
minMargin: 15,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 12,
color: '#999'
}
}
},
labelLine: {
length: 15,
length2: 0,
maxSurfaceAngle: 80
},
labelLayout: function (params) {
const isLeft = params.labelRect.x < myChart.getWidth() / 2;
const points = params.labelLinePoints;
points[2][0] = isLeft
? params.labelRect.x
: params.labelRect.x + params.labelRect.width;
return {
labelLinePoints: points
};
},
data: data
}
]
};
myChart.setOption(option);
})();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。