配置项如下
option = {
tooltip : {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
},
textStyle: {
fontSize:20
}
},
legend: {
data:['pv-10-30上线前一周','pv-10-30上线后第一周'],
textStyle: {
fontSize:18
}
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '20%',
right: '20%',
bottom: '60%',
containLabel: true
},
xAxis : [
{
type : 'category',
boundaryGap : false,
axisLine: {
lineStyle: {
color: 'black'
}
},
data : ['周三','周四','周五','周六','周日', '周一','周二']
}
],
yAxis : [
{
type : 'value',
axisLine: {
lineStyle: {
color: 'black'
}
}
}
],
series : [
{
name:'pv-10-30上线前一周',
type:'line',
stack: '总量',
areaStyle: {},
label: {
normal: {
show: true,
position: 'top',
fontSize:16
}
},
data:[57, 40, 37, 1, 3, 30, 80]
},
{
name:'pv-10-30上线后第一周',
type:'line',
stack: '总量',
areaStyle: {},
label: {
normal: {
show: true,
position: 'top',
fontSize:18
}
},
data:[416, 383, 254, 48, 45, 304, 338]
}
]
};