option = { color: ['#3398DB'], tooltip: { trigger: 'axis', axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: '', // 默认为直线,可选为:'line' | 'shadow' }, }, grid: { left: '4%', right: '4%', bottom: '2%', containLabel: true, }, xAxis: [ { type: 'category', data: [ '第一工程公司', '第二工程公司', '第三工程公司', '第四工程公司', '第五工程公司', '第六工程公司', '第七工程公司', '第八工程公司', '第十工程公司', '第一安装公司', '第二安装公司', '新疆公司', '阜外公司', '无锡公司', ], axisTick: { alignWithLabel: true, }, axisLine: { lineStyle: { type: 'solid', color: '#d9d9d9', //左边线的颜色 width: '2', //坐标线的宽度 }, }, axisLabel: { textStyle: { //改变刻度字体样式 color: '#666', fontSize: 14, }, formatter: function (value) { return value.split('').join('\n') }, }, }, ], yAxis: [ { type: 'value', formatter: '{value} (元)', // 单位 axisLabel: { textStyle: { //改变刻度字体样式 color: '#666', }, }, axisLine: { show: false, //y轴线消失 }, axisTick: { show: false, //y轴坐标点消失 }, }, ], series: [ { name: '公司产值', type: 'bar', barWidth: '20', data: [400, 52, 200, 33, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200], itemStyle: { //柱形图圆角,鼠标移上去效果 emphasis: { barBorderRadius: [10, 10, 10, 10], }, normal: { //柱形图圆角,初始化效果 barBorderRadius: [10, 10, 10, 10], color: new echarts.graphic.LinearGradient( 0, 1, 0, 0, [ { offset: 0, color: '#7e88f3', // 100% 处的颜色 }, { offset: 0.3, color: '#7e98f3', // 60% 处的颜色 }, { offset: 0.8, color: '#7eaaf3', // 60% 处的颜色 }, { offset: 1, color: '#7ac1f3 ', // 0% 处的颜色 }, ], false ), }, }, }, ], }