这个折线图我是动态添加的而且是定时更新按照时间添加的,我想在上面添加一条平行与x轴的线,我一开始是添加到data里面的但是手动添加后这个线也一直在重新绘制了,x轴上面最多只显示10个点,超出了会把第一个删除,后面的加进来,这种的要任何绘制啊?
配置项如下
var option = {
title: {
text: '折线图'
},
tooltip: {
trigger: 'axis'
},
legend: {
show: false,
data: ['admin5', 'user'],
axisPointer : {
type : 'line',
lineStyle : {
color : 'yellow',
width : 1,
type : 'solid'
}
}
}, //头上显示说明的文字
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['10:25', '10:27', '10:29', '10:31', '10:33', '10:35', '10:37'],
axisPointer : {
type : 'line',
lineStyle : {
color : 'blue',
width : 1,
type : 'solid'
}
}
}, //x轴显示的文字
yAxis: {
type: 'value',
splitLine: {
lineStyle: {
type: 'dashed'
}
},
scale: true,
axisLabel: {
formatter: '{value} (信号)'
},
axisPointer : {
show: true,
type : 'line',
lineStyle : {
color : 'red',
width : 1,
type : 'solid'
}
}
},
series: [{
name: 'admin',
type: 'line',
stack: '总量',
symbolSize: function(data) {
return 10;
},
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'admin2',
type: 'line',
stack: '总量',
symbolSize: function(data) {
return 10;
},
data: [10, 132, 11, 13, 90, 20, 20]
}]
};