我给markLine传一个数值,当这个数值过大就会消失不见
配置项如下
option = {
title: {
text: '自定义markLine数值',
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['最高气温']
},
toolbox: {
show: true,
feature: {
dataZoom: {
yAxisIndex: 'none'
},
dataView: {
readOnly: false
},
magicType: {
type: ['line', 'bar']
},
restore: {},
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value} °C'
}
},
series: [{
name: '温度',
type: 'line',
data: [11, 11, 15, 13, 12, 13, 10],
markLine: {
itemStyle : {
normal: {
borderWidth:1,
lineStyle: {
type: 'dashed', //dotted、solid
color:'orange',
width:2
},
}
},
data: [{
name: '固定横线',
yAxis: 12
//大于15就会消失
}],
}
}]
};