左側爲官網實例 右側爲項目要求
寫博客不是爲了博眼球 是爲了記筆記
<div id="Circlechart"></div>
Circlelinechart(){
let myChart = echarts.init(document.getElementById("Circlechart"));
let option = {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
legend: {
orient: 'horizontal',
x: 'center',
y : 'bottom',
data:['直接訪問','郵件營銷','聯盟廣告','視頻廣告','搜索引擎']
},
series: [
{
name:'訪問來源',
type:'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
show: true,
position: 'outside'
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: true,
length: 20,
length2: 20,
lineStyle: {
color: '#333'
}
}
},
data:[
{value:335, name:'直接訪問'},
{value:310, name:'郵件營銷'},
{value:234, name:'聯盟廣告'},
{value:135, name:'視頻廣告'},
{value:1548, name:'搜索引擎'}
]
}
]
};
myChart.setOption(option);
},