option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
show:false,
type: 'value'
},
series: [{
data: [320, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
label: {
normal: {
show: true,
distance: 3,
fontSize: 11,
color: "#333",
formatter: (opt) => { //设置拐点文字颜色
if (opt.value > 1200) return '{a|' + opt.value + '}';
},
rich: {
a: {
color: 'red',
}
}
},
},
markArea: { //标记区域
data: [
[{
yAxis: '200',
itemStyle: {
color: '#fffb87'
}
}, {
yAxis: '400'
}],
[{
yAxis: '400',
itemStyle: {
color: '#ffe087'
}
}, {
yAxis: '800'
}],
[{
yAxis: '800',
itemStyle: {
color: '#ffe1e1'
}
}, {
yAxis: '1200'
}],
]
},
markLine: {
data: [{
yAxis: '200',lineStyle:{opacity:0},
},{
yAxis: '400',lineStyle:{opacity:0},
},{
yAxis: '800',lineStyle:{opacity:0},
},{
yAxis: '1200',lineStyle:{opacity:0},
}],
label:{
show:true,
position:"start",
color:"#000",
},
},
}]
};