关于如何设置echart图例(legend)的位置 您所在的位置:网站首页 图例位置底部 关于如何设置echart图例(legend)的位置

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

2024-07-05 11:27| 来源: 网络整理| 查看: 265

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轴设置图例位置垂直方向的上下左右



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有