option = {
title: {
text: '堆疊區域圖'
},
tooltip : {
trigger: 'axis',
axisPointer: {
type: 'cross',
z: 1,//豎線在圓圈後面
label: {
backgroundColor: 'rgba(0,0,0,0)',
color: 'red'
},
},
confine: true,//浮窗不超出屏幕範圍
},
legend: {
type: 'plain',
icon: 'circle',
data:['郵件營銷','聯盟廣告']
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
show: true,
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
borderWidth: 1,
borderColor: 'blue',
backgroundColor: '#fff',
},
xAxis : [
{
type : 'category',
boundaryGap : false,
data : ['週一','週二','週三','週四','週五','週六','週日'],
axisLine: {
lineStyle: {
width: 0,//x軸不顯示軸線
}
},
axisTick: {
show: false,//不顯示刻度
},
splitLine: {
show: true,//顯示縱向網格線
},
axisLabel: {
interval: 0,
showMaxLabel: true,//顯示最大刻度值
}
}
],
yAxis : [
{
type : 'value',
splitLine: {
show: false,//不顯示橫向網格線
}
}
],
series : [
{
name:'郵件營銷',
type:'line',
stack: '總量',
areaStyle: {},
data:[120, 132, 101, 134, 90, 230, 210],
symbol: 'circle',
},
{
name:'聯盟廣告',
type:'line',
stack: '總量',
areaStyle: {},
data:[220, 182, 191, 234, 290, 330, 310],
symbol: 'circle',
},
]
};