乐趣区

关于echarts:echarts图表markLine的用法与设置多条不同颜色markLine

一、在 series 下,新增 markLine:
markLine: {

symbol: 'none',
label:{// position:[10, 10],
    color:'#FF1D00',
    fontSize:12,
    formatter:"危险 (40dB)"
},
lineStyle:{
    type:'solid',
    color: '#FF1D00',
    width: 1
},
data: [{xAxis: '40', name:'危险 (40dB)'},
]

},

二、多条不同色彩 markLine
markLine: {

symbol: 'none',
label:{
    color:'#FF1D00',
    fontSize:12,
    formatter:"危险 (40dB)"
},
lineStyle:{
    type:'solid',
    color: '#FF1D00',
    width: 1
},
data: [{yAxis: '40',lineStyle: {color: '#FF1D00'},label: {color: '#FF1D00',formatter:'危险 (40dB)',fontSize:10}},
{yAxis: '25',lineStyle: {color: '#FF7804'},label: {color: '#FF7804',formatter:'异样 (25dB)',fontSize:10}}]

},

退出移动版