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

]

  效果如下图

echarts饼图设置渐变色

 

上一篇:echarts 纵轴 label 精度处理


下一篇:vue echarts 多个图表自适应