option = { //你的代码 tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, grid: { left: '3%', right: '5%', bottom: '0%',top:'120px', containLabel: true }, legend: {top: '5%',data: ['A', 'B','C','C','E','F','G','H']}, icon: "circle", color: ['#F47560','#E8A838','#A6D854','#E78AC3','#8DA0CB','#61CDBB','#F1E15B','#E8C1A0'], xAxis: { type: 'category', axisLabel: { show: true, textStyle: { color: 'rgba(112, 151, 184, 1)' } }, axisLine: { lineStyle: { color: 'rgba(112, 151, 184, 1)' } }, data: ['2009','2020','2021','2022'] }, yAxis: { type: 'value', name: '(万元)', axisLabel: { show: true, textStyle: { color: 'rgba(112, 151, 184, 1)' } }, nameTextStyle: { color: 'rgba(112, 151, 184, 1)' }, axisLine: { lineStyle: { color: 'rgba(112, 151, 184, 1)' } }, splitLine: { lineStyle: { type: 'dashed' } } }, series: [ { type: 'bar',barWidth: 8,name:'A', data: [20, 24, 18, 22], }, { type: 'bar',barWidth: 8,name:'B', data: [10, 17, 30,22], }, { type: 'bar',barWidth: 8,name:'C', data: [20, 18, 15,22], }, { type: 'bar',barWidth: 8,name:'D', data: [10, 20, 24, 18], }, { type: 'bar',barWidth: 8,name:'E', data: [10, 17, 30,22], }, { type: 'bar',barWidth: 8,name:'F', data: [-20, -10, -24, -18], }, { type: 'bar',barWidth: 8,name:'G', data: [10, 20, 24, 18], }, { type: 'bar',barWidth: 8,name:'H', data: [20, 18, 17,22], } ] };