渐变饼状图

描述:当前是关于Echarts图表中的 饼图 示例。
 
            option = {
   backgroundColor: "rgba(0,0,0,0.8)",
   tooltip: {
      trigger: 'item',
      backgroundColor: "rgba(0,0,0,0.8)",
      borderColor: "#BD10E0",
      textStyle: {
        fontSize: "0.125rem",
        color: "#fff",
        fontWeight: "normal"
      }
    },
    series: [{
      type: 'pie',
      radius: '80%',
      center: ['50%', '50%'],
      data:  [
    { value: 15, name: 'P0' },
    { value: 30, name: 'P1' },
    { value: 20, name: 'P2' },
    { value: 30, name: 'P3' },
  ],
      roseType: 'radius',
      label: {
        fontSize: "20",
        color: 'inactive',
        formatter: '{b}: {d}%'
      },
      itemStyle: {
        color: (list) => {
          let colorList = [
            {
              l: 1,
              b: 0,
              r: 0,
              t: 0,
              colorStart: '#24C6FF',
              colorEnd: '#2490FF'
            },
            {
              l: 0,
              b: 0,
              r: 1,
              t: 0,
              colorStart: '#9300FF',
              colorEnd: '#D700FF'
            },
            {
              l: 0,
              b: 0,
              r: 0,
              t: 1,
              colorStart: '#6E48DC',
              colorEnd: '#494CDE'
            },
            {
              l: 0,
              b: 1,
              r: 0,
              t: 0,
              colorStart: ' #761D8D',
              colorEnd: '#8C1D8A'
            }
          ]
          return new echarts.graphic.LinearGradient(
            colorList[list.dataIndex]['l'],
            colorList[list.dataIndex]['b'],
            colorList[list.dataIndex]['r'],
            colorList[list.dataIndex]['t'], [{
              offset: 0,
              color: colorList[list.dataIndex]['colorStart']
            }, {
              offset: 1,
              color: colorList[list.dataIndex]['colorEnd']
            }])
        }
      },
      animationType: 'scale',
      animationEasing: 'elasticOut',
      animationDelay: function (idx) {
        return Math.random() * 200;
      }
    }
    ]
};