Echarts图形设置渐变色

“岑夫子,丹丘生.将进酒,杯莫停”
给柱状图设置渐变色,效果如下:
这里写图片描述
设置代码如下:

series: [
            {
                name: '',
                type: 'bar',
                data: data.seriesList,
                 itemStyle: {
                  normal: {
                  //设置渐变色
                    color: new echarts.graphic.LinearGradient(
                      0, 0, 0, 1,
                    [
                       {offset: 0, color: '#e6584c'},
                        {offset: 1, color: '#f18a82'}
                    ])
                    }
                }
            }
        ]

猜你喜欢

转载自blog.csdn.net/a_runner/article/details/80229159