折线图(多条)
function lineChart(id,echarts,xdata,ydata,title,legend){
let dom = document.getElementById(id);
let myChart = echarts.init(dom);
let option = null;
option = {
color:['#FF00ED', '#9311FF', '#00B6F5','#FFB10D','#00FF00'],
title: {
text: title,
top:16,left:12,
textStyle:{
fontSize:14
}
},
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data: legend, top:30,right:20,
bottom:"auto",
itemWidth:12,
itemHeight:12,
width:"60%",
textStyle:{
color:"#333",
fontSize:12
}
},
grid: {
left: '30',
right: '30',
bottom: '20',
top: '100',
containLabel: true
},
toolbox: {
// feature: {
// saveAsImage: {}
// }
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLine:{
lineStyle:{
color:{
colorStops: [{
offset: 0, color: '#43BAD8'
}, {
offset: 1, color: '#43BAD8'
}],
}
}
},
data: xdata
},
yAxis: {
type: 'value',
axisLine: {
show: false
},
axisTick: {
lineStyle: {color: '#fff'}//坐标轴刻度
},
splitLine: {
lineStyle: {color: '#BDE5F0', type : '