饼图

描述:当前是关于Echarts图表中的 饼图 示例。
 
            let datas = [
  {
    name: "有功功率",
    value: 60,
  },
  {
    name: "无功功率",
    value: 40,
  },
];

var option = {
  "backgroundColor": "#1B232E",
  color: [
     "rgba(251, 210, 65, 1)",
      "rgba(240, 244, 255, 1)",
      ],
  title: {
        text: '功率占比',
        left: 'center',
        top: 'center',
        textStyle: {
            color: "rgba(219, 230, 255, 0.80)",
            fontWeight: 'bold',
            fontSize: "14",
        }
    },
  legend: {
    itemHeight: 14,
    itemWidth: 14,
    itemGap: 30,
    icon: "rect",
    orient: "horizontal",
    /*top: "center",*/
    bottom: '2%',
    left: 'center',
    align: 'auto',
    textStyle: {
      align: "left",
      color: "#",
      verticalAlign: "middle",
      rich: {
        name: {
          width: 80,
          fontSize: 16,
        },
        value: {
          width: 20,
          align: "right",
          fontFamily: "Medium",
          fontSize: 16,
        },
        rate: {
          width: 10,
          align: "right",
          fontSize: 16,
        },
      },
    },
    data: datas,
    inactiveColor: "rgba(73, 93, 118, 0.5)"

  },
  tooltip: {
    trigger: "item",
    formatter: "{d}%",
    textStyle: {
      color: "rgba(255, 255, 255, 1)"
    },
    backgroundColor: "rgba(0,0,0,0.8)",
    borderColor: "rgba(219, 230, 255, 0.8)",
  },
  series: [
    {
      name: "",
      type: "pie",
      radius: ["20%", "50%"],
      center: ["50%", "50%"],
      roseType: "radius",
      label: {
        formatter: "{d}%",
      },
      labelLine: {
        length: 10,
        length2: 30,
      },
      data: datas,
    },
  ],
};