option = { //你的代码 backgroundColor: "#001829", grid: { containLabel: true, top: 30, right: 15, bottom: 0, left: 15 }, legend: { show: true, data: ['营收金额', '同比增长'], textStyle: { fontSize: 18, color: '#ffffff' }, }, tooltip: { trigger: "axis", axisPointer: { type: "shadow" } }, xAxis: { type: "category", data: ['2022年', '2021年', '2020年', '2019年', '2018年'], axisLine: { show: true, lineStyle: { color: "#7097B8", type: "solid" } }, axisTick: { show: false }, axisLabel: { interval: 0, show: true, fontSize: 14, color: "#7097B8", fontFamily: "SourceHanSansCN-Normal, SourceHanSansCN" } }, yAxis: [ { axisLine: { show: false }, axisTick: { show: false }, axisLabel: { show: true, fontSize: 14, color: "#7097B8", fontFamily: "SourceHanSansCN-Normal, SourceHanSansCN", formatter: '{value} 万元' }, splitLine: { show: false } }, { axisLine: { show: false }, axisTick: { show: false }, axisLabel: { show: true, fontSize: 14, color: "#7097B8", fontFamily: "SourceHanSansCN-Normal, SourceHanSansCN", formatter: '{value} %' }, splitLine: { show: false } }, ], series: [ { name: '营收金额', type: "bar", barWidth: "50%", showBackground: true, backgroundStyle: { color: "rgba(14,58,99, .5)" }, itemStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: "rgba(3, 255, 150, 1)" }, { offset: 1, color: "rgba(0, 251, 255, 0)" } ]) }, emphasis: { itemStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: "#83bff6" }, { offset: 1, color: "#2378f7" } ]) } }, data: [132, 66, 54, 37, 88] }, { name: "同比增长", type: "line", yAxisIndex: 1, itemStyle: { normal: { lineStyle: { color: "#FFA600", //改变折线颜色 }, }, }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ // 渐变颜色 { offset: 0, color: 'rgba(255, 166, 0, 0.3)', }, { offset: 1, color: 'rgba(255, 166, 0, 0.5)', }, ], global: false, }, }, smooth: false, showAllSymbol: true, symbol: "emptyCircle", symbolSize: 6, data: [1, 1.2, 3, 1, 1.5, 1] } ] };