热门搜索 :
考研考公
您的当前位置:首页正文

Echarts设置柱状图渐变色

来源:东饰资讯网

效果:

代码:

series: [{
    itemStyle: {
        normal: {
            color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
                offset: 0,
                color: "red" // 0% 处的颜色
            }, {
                offset: 0.6,
                color: "blue" // 60% 处的颜色
            }, {
                offset: 1,
                color: "yellow" // 100% 处的颜色
            }], false)
        }
    }
}]
Top