EChars设置柱状图颜色渐变及柱状图粗细大小

575 阅读1分钟
series: [{
            data: [this.dataGovernData.requirementListTotal, this.dataGovernData.responsibilityListTotal, this.dataGovernData.negativeListTotal],
            name:'数量',
            type:'bar',
            //设置柱状图大小
            barWidth: '60%',
            //给柱状图添加渐变色,颜色渐变方向是从低到上从#1E7FFE到#FFFFFF
            itemStyle: {
              normal: {
                color: new echarts.graphic.LinearGradient(
                  0, 0, 0, 1,            // 0,0,1,0表示从左向右    0,0,0,1表示从右向左
                  [
                    {offset:0, color: '#FFFFFF'},
                    {offset:1, color: '#1E7FFE'}
                  ]),
              }
            },
          }]

效果如图:柱状条颜色渐变