效果图
具体代码
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value',
axisLabel: {
show: true,
textStyle: {
color:function(data){
if(data <= 900) {
return 'red'
} else {
return 'blue'
}
}
}
},
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line'
}]
}