//echarts series上面的数字显示到最右部 需要在图画完后加入如下代码
setTimeout(function(){
var width = chart.getWidth();
var opt = chart.getOption();
var grid = opt.grid[0];
var right = grid.right;
var left = grid.left;
right = width*parseFloat(right)/100;
left = width*parseFloat(left)/100;
var x = width-left-right;
chart.setOption({
series:[{
label:{
show:true,
position:'left',
offset:[x+50,0]
}
}]
})
})
//echarts series上面的数字显示到最顶部 需要在图画完后加入如下代码
setTimeout(function(){
var heigth = chart.getHeight();
var opt = chart.getOption();
var grid = opt.grid[0];
var top = grid.top;
var bottom = grid.bottom;
top = height*parseFloat(top)/100;
bottom = height*parseFloat(bottom)/100;
var y = height-bottom-top;
chart.setOption({
series:[{
label:{
show:true,
position:'bottom',
offset:[0,-y-30]
}
}]
})
})
左对齐参考这篇:echart 柱状图如何让y轴文字靠左显示,series上文字右对齐显示_aka小帅的博客-CSDN博客