关于如何设置echart图例(legend)的位置

legend: {

orient: 'horizontal', // 'vertical'

x: 'right', // 'center' | 'left' | {number},

y: 'top', // 'center' | 'bottom' | {number}

backgroundColor: '#fff', borderColor: 'rgba(178,34,34,0.8)',

borderWidth: 4,

padding: 10, // [5, 10, 15, 20]

itemGap: 20, textStyle: {color: 'red'},

selected: { '降水量': false },

data: [{ name: '蒸发量', icon: 'circle',//'image://../asset/ico/favicon.png',//标志图形类型,默认自动选择(8种类型循环使用,不显示标志图形可设为'none'),默认循环选择类型有:'circle' | 'rectangle' | 'triangle' | 'diamond' |'emptyCircle' | 'emptyRectangle' | 'emptyTriangle' | 'emptyDiamond'另外,还支持五种更特别的标志图形'heart'(心形)、'droplet'(水滴)、'pin'(标注)、'arrow'(箭头)和'star'(五角星),这并不出现在常规的8类图形中,但无论是在系列级还是数据级上你都可以指定使用,同时,'star' + n(n>=3)可变化出N角星,如指定为'star6'则可以显示6角星

textStyle: {fontWeight: 'bold', color: 'green'}

},

'降水量', '最高气温', '最低气温'

] }

x轴设置图例位置水平方向上的上下左右

y轴设置图例位置垂直方向的上下左右

猜你喜欢

转载自blog.csdn.net/yijiupingfan0914/article/details/80278681
今日推荐