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,
  }

]

  效果如下图

 

posted @ 2021-11-19 09:30  我的世界蹦擦擦  Views(3845)  Comments(0Edit  收藏  举报