我想为条形图的VALUE设置一个数据标签,以及始终位于条形图左侧的SERIES(在我的情况下为#34; bar1,bar2,bar3和#34;)的值。就像它在图片中一样。
这是我的代码
plotOptions: {
bar: {
dataLabels: {
padding: 0,
allowOverlap: true,
enabled: true,
align: 'left',
color: '#FFFFFF',
inside: true,
crop: false,
overflow: "none",
formatter: function() {
return this.series.name + " " + this.y;
},
style: {
width:100
}
.
.
.
答案 0 :(得分:0)
只需增加align: right
中的plotOptions
。
我希望这能解决你的问题。
plotOptions: {
bar: {
dataLabels: {
padding:0,
allowOverlap:true,
enabled: true,
align: 'right',
color: '#FFFFFF',
inside: true,
crop: false,
overflow:"none",
formatter: function() {
return this.series.name+ " "+ this.y;
console.log(this.series.name);
},