Echarts图表设置图例的间距、图例颜色块的宽度、高度、文字的样式、图例的显示方式

906 阅读1分钟

在legend中设置itemGap的属性

 legend: {
          itemWidth: 14, //图例颜色块的宽度
          itemHeight: 5, //图例颜色块的高度
          itemGap: 10, //设置图例之间的间距
          orient: 'vertical',//图例的显示方式 默认横向显示
          bottom: 0,//控制图例出现的距离 默认左上角
          left: 'left',//控制图例的位置
          data: ["多式联运平台","物流管理系统"],
          left: '0%',
          top:'0%',
          textStyle: {//图例中文字的样式
            fontSize: this.legendFontSize,
            color: '#fff'
          }
        },