代码:
option = { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value', }, series: [ { name: '数据系列1', type: 'line', data: [120, 200, 150, 80, 70, 110, 130], markLine: { symbol: 'none', data: [{ yAxis: 120, lineStyle: { color: 'red', type: 'dashed', width: 2 }, label: { show: true, position: 'end', formatter: '警戒线' } }] } }, { name: '数据系列2', type: 'line', data: [80, 90, 100, 120, 110, 100, 90] } ] };
效果:
标签:echart,警戒线,data,120,添加,110,type From: https://www.cnblogs.com/crazycode2/p/17614817.html