echarts饼图设置渐变色


设置渐变色

 color1 = new ECharts.graphic.LinearGradient(0,1,0,0,[{ offset: 0, color: "rgba(100,160,255,0.5)" }, { offset: 1, color: "#0AC8FF" }],false)
 color2 = new ECharts.graphic.LinearGradient(0,1,0,0,[{ offset: 0, color: "rgba(15,75,255,0.5)" }, { offset: 1, color: "#6D7BFF" }],false)
style = [color2, color2]

  带入echarts饼图

series:[
  {
    type: 'pie',   
    color: style,
  }

]

  效果如下图