echarts markline 不同颜色

option = {
xAxis: {
type: 'category',
data: [1,2,3,4,5,6,7]
},
yAxis: {
type: 'value'
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
markLine: {
symbol:'none',
data: [
[
{

itemStyle:{
normal:{
show:true,
color:'green'
}
},
lineStyle: {
normal: {
type: 'solid',
color: 'green'
}
},
coord:[0, 820]
},
{
coord:[3, 934]
}
],
[
{
itemStyle:{
normal:{
show:true,
color:'red'
}
},
lineStyle: {
normal: {
type: 'solid',
color: 'red'
}
},
coord:[3, 934]
},
{

coord:[6, 1320]
}
],
]
},

}
]
};

原文地址:https://www.cnblogs.com/yixiaoyang-/p/9935089.html