美文网首页
Echarts设置柱状图渐变色

Echarts设置柱状图渐变色

作者: Hi小胡 | 来源:发表于2018-02-27 11:08 被阅读3206次

效果:

代码:

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)
        }
    }
}]

相关文章

网友评论

      本文标题:Echarts设置柱状图渐变色

      本文链接:https://www.haomeiwen.com/subject/aoupxftx.html