option = { legend: { top: "5%", itemHeight: 10, data: ['图例1', '图例2'], textStyle: { color: '#4C67B5' }, }, backgroundColor: '#000', tooltip: { showContent: true, trigger: 'item' }, textStyle: { color: '#c0c3cd', fontSize: 14 }, grid: { top: '13%', left: '5%', bottom: '15%', right: '5%' }, xAxis: { nameTextStyle: { color: '#c0c3cd', padding: [0, 0, -10, 0], fontSize: 14 }, axisLabel: { interval: 0, textStyle: { color: '#639FD2' //坐标轴字颜色 }, margin: 15 }, axisTick: { show: false //隐藏X轴刻度 }, splitLine: { //网格线 show: false }, data: [ '指标1', '指标2', '指标3', '指标4', '指标5', '指标6', '指标7', '指标8' ], type: 'category' }, yAxis: { axisLine: { show: false, //隐藏X轴轴线 lineStyle: { color: '#11417a' } }, axisTick: { show: false //隐藏X轴刻度 }, axisLabel: { textStyle: { color: '#fff' } }, splitLine: { //网格线 show: true, lineStyle: { type: 'dashed', color: '#4A4E54' }, splitNumber: 3 } }, series: [ { name: '各品种产量', data: [2.8, 2.7, 2.75, 2.68, 3.1, 3.5, 2.9, 2.95], type: 'bar', barWidth: 30, itemStyle: { normal: { color: function (params) { var colorList = [ '#C0A230', '#B48A1A', '#956525', '#975330', '#855241', '#9C7564', '#B59181', '#CFAFA0', '#B59181' ]; return colorList[params.dataIndex]; } }, color: { x: 0, y: 0, x2: 0, y2: 1, type: 'linear', global: false, colorStops: [ { offset: 0, color: '#0b9eff' }, { offset: 1, color: '#63caff' } ] } }, label: { show: false } }, { name: '图例2', data: [3, 5, 4, 10, 6, 5, 6, 8], type: 'line', symbol: 'none', lineStyle: { type: 'dashed' }, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 1, 0, [ { offset: 0, color: '#D19176' // 0% 处的颜色 }, { offset: 0.5, color: '#D77453' }, { offset: 1, color: '#E50715' // 100% 处的颜色 } ], false ) } }, { name: '图例1', data: [1, 3, 2, 8, 5, 7, 6, 4], type: 'line', symbol: 'none', lineStyle: { type: 'dashed' }, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 1, 0, [ { offset: 0, color: '#00873E' // 0% 处的颜色 }, { offset: 0.5, color: '#349544' }, { offset: 1, color: '#91A04F' // 100% 处的颜色 } ], false ) } } ] };