/* 作为轴名称的刻度(type:category) 两条以及以上且2两条 第二条可以设置offset 偏移; 此图为例横向的图y轴就是用来显示柱子的name 显示数值一列则不需要两条以及以上 */ option = { title: { text: 'x和y轴的间距以及柱状图柱子踩上柱子了' }, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, legend: {}, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: [ { type: 'value', axisLine: { show: true, lineStyle: { width: 1 } }, show: true, offset:20, maxInterval:50000 //值坐标最大的数值间隔 最小同样min } ], yAxis: [ { type: 'category', data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World'], axisLine: { show: true, lineStyle: { width: 0 } }, show: false, position: 'left', }, { type: 'category', data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World'], axisLine: { show: true, lineStyle: { width: 2 } }, axisLabel: { margin: 20 }, nameGap: 20, position: 'left', offset:20, } ], series: [ { name: '2011', type: 'bar', // xAxisIndex:1, data: [18203, 23489, 29034, 104970, 131744, 630230] }, { name: '2012', type: 'bar', // xAxisIndex:1, data: [19325, 23438, 31000, 121594, 134141, 681807] } ] };