1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
| var zhuzhuangDemo= { title: { text: '柱状图demo', // subtext: '纯属虚构', x: 'right', y: 'bottom', textStyle: { fontWeight: 'normal', //标题颜色 color: "#fff", fontSize: 10 } }, tooltip: { formatter: function (params, vals) { var val = params[0].name + ' : \n' + params[0].data * 1000000 return val }, trigger: 'axis', axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' } }, grid: { left: '1%', right: '1%', top: '10%', bottom: '14%', containLabel: true }, xAxis: [ { splitLine: {show: false},//去除网格线 axisLine: { lineStyle: { color: 'rgba(0, 0, 0, 0)' } }, label: { position: 'insideRight' }, type: 'category', axisLabel: { //调整x轴的lable interval: 0, //X轴信息全部显示; textStyle: { fontSize: 12, color: "#fff" }, formatter: function (value) { //x轴的文字改为竖版显示 var str = value.split(""); return str.join("\n"); // return '{a|' + value + '}'; } }, data: num1, axisTick: { alignWithLabel: false } } ], yAxis: [ { splitLine: {show: false},//去除网格线 axisLine: { lineStyle: { color: 'rgba(0, 0, 0, 0)' } }, type: 'value', axisLabel: { //调整x轴的lable formatter: '{value} 百万', // rotate: -45, //文字逆时针旋转45° textStyle: { fontSize: 10, color: "#fff" } }, } ], series: [ { name: '分布', type: 'bar', barWidth: '50%', data: [{name: '北京', value: '232144789'},{name: '上海', value: '789124823'},{name: '南京', value: '123478789123'}], itemStyle: { normal: { fontSize: 8, //颜色渐变 color: ' } } } ] };
|