option = { xAxis: { type: 'category', boundaryGap: false, data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] }, yAxis: { type: 'value' // boundaryGap: [0, '30%'] }, visualMap: { type: 'piecewise', show: false, seriesIndex :0, pieces: [ { lte: 300, color: 'orange' }, { gt: 300, lte: 400, color: 'green' }, { gt: 400, color: '#ff0000' } ] }, series: [ { type: 'line', smooth: 0.6, symbol: 'none', data: [200, 560, 750, 580, 300, 220, 600, 200, 420], markLine: { itemStyle: { // 基线公共样式 normal: { lineStyle: { // 'solid'实线;'dashed'虚线;'dotted'点线 type: 'dashed' }, label: { show: true, position: 'end', formatter: '{b}{c}' } } }, data: [ { name: '红色预警', type: 'average', yAxis: 400, lineStyle: { color: '#ff0000' } }, { name: '黄色预警', type: 'average', yAxis: 300, lineStyle: { color: 'orange' } } ] } }, { type: 'line', smooth: 0.6, symbol: 'none', data:[560, 750, 580,200, 381, 750, 580,200, 560, 100, 580] } ] };