option = { color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'], tooltip: { trigger: 'axis', axisPointer: { type: 'cross', label: { backgroundColor: '#6a7985' } } }, legend: { data: [ { name: '昨日', type: 'plain' }, { name: '今日' } ] }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: [ { type: 'category', boundaryGap: false, data: [ '24:00', '03:00', '06:00', '09:00', '12:00', '15:00', '18:00', '21:00', '24:00' ] } ], yAxis: [ { type: 'value' } ], series: [ { name: '昨日', type: 'line', smooth: true, lineStyle: { width: 0 }, showSymbol: false, areaStyle: { opacity: 0.5, color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgb(128, 255, 165)' }, { offset: 1, color: 'rgb(1, 191, 236)' } ]) }, emphasis: { focus: 'series' }, data: [0, 150, 101, 224, 90, 200, 50, 110, 20] }, { name: '今日', type: 'line', smooth: true, lineStyle: { width: 0 }, showSymbol: false, areaStyle: { opacity: 0.5, color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgb(55, 162, 255)' }, { offset: 1, color: 'rgb(116, 21, 219)' } ]) }, emphasis: { focus: 'series' }, data: [0, 80, 120, 80, 164, 130, 190, 100, 10] } ] }; option && myChart.setOption(option);