echars 柱状图靠左_echart 柱状图如何让y轴文字靠左显示,series上文字右对齐显示...

option = {

title: {

text: '世界人口总量',

subtext: '数据来自网络'

},

tooltip: {

trigger: 'axis',

axisPointer: {

type: 'shadow'

}

},

legend: {

data: ['2011年', '2012年']

},

grid: {

left: '3%',

right: '4%',

bottom: '3%',

containLabel: true

},

xAxis: {

type: 'value',

boundaryGap: [0, 0.01],

splitLine: { // 网格线

show: false

}

},

yAxis: {

type: 'category',

data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)'],

axisLabel: { // y轴文字的配置

show: true,

interval: 0,

textStyle: {

align: 'right',

},

},

},

series: [

{

name: '2011年',

type: 'bar',

data: [18203, 23489, 29034, 104970, 131744, 630230],

label: {

show: true, // 开启显示

position: 'right', // 在上方显示

textStyle: {

fontSize: 15

}

}

},

{

name: '2012年',

type: 'bar',

data: [19325, 23438, 31000, 121594, 134141, 681807],

label: {

show: true, // 开启显示

position: 'right', // 在上方显示

textStyle: {

fontSize: 15

}

}

}

]

};

3b77fdfcab1e21ef7bcb2dc769f35d4c.png

这种效果的

谢谢。


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部