IT-shen

itemStyle控制柱形的样式。如下:

itemStyle: {
normal: {
color: \'#fff\', //填充色
barBorderColor: \'#4876FF\', //边框色
barBorderWidth: 3, //边框宽度
barBorderRadius:2, //圆角半径
label : { //标签显示位置
show: true,
position: \'top\' //insideTop 或者横向的 insideLeft

}
}
}

例子:

 

option = {
title : {
text: \'世界人口总量\',
subtext: \'数据来自网络\'
},
tooltip : {
trigger: \'axis\'
},
legend: {
data:[\'2011年\', \'2012年\']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType: {show: true, type: [\'line\', \'bar\']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
type : \'value\',
boundaryGap : [0, 0.01]
}
],
yAxis : [
{
type : \'category\',
data : [\'巴西\',\'印尼\',\'美国\',\'印度\',\'中国\',\'世界人口(万)\']
}
],
series : [
{
name:\'2011年\',
type:\'bar\',
itemStyle: {
normal: {
color: \'#fff\',
barBorderColor: \'#4876FF\',
barBorderWidth: 3,
barBorderRadius:2,
label : {
show: true,
position: \'insideLeft\'

}
}
},
data:[18203, 23489, 29034, 104970, 131744, 630230]
},
{
name:\'2012年\',
type:\'bar\',
itemStyle: {
normal: {
color: \'#fff\',
barBorderColor: \'#4876FF\',
barBorderWidth: 3,
barBorderRadius:2,
label : {
show: true,
position: \'top\'

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

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2021-09-28
  • 2021-08-29
  • 2021-06-18
  • 2021-10-31
  • 2021-06-08
  • 2021-06-21
  • 2022-01-07
猜你喜欢
  • 2021-05-08
  • 2021-10-01
  • 2021-12-30
  • 2021-12-05
  • 2021-11-04
  • 2021-08-10
  • 2021-06-06
相关资源
相似解决方案