描述:当前是关于Echarts图表中的 饼图 示例。
 
            // 政府及部门
const colorList = ['rgba(255, 115, 91, 1)', 'rgba(65, 201, 147, 1)', 'rgba(255, 157, 59, 1)', 'rgba(59, 117, 241, 1)',];

const data = [
  {
    value: 200,
    type: '事故灾难',
  },
  {
    value: 37,
    type: '社会安全',
  },
  {
    value: 529,
    type: '公共卫生',
  },
  {
    value: 701,
    type: '自然灾难',

  },
]
option = {
     backgroundColor: '#fff',
  tooltip: {
      formatter: function (param) {

          return param.data.type + ':' + ((param.value/total*100).toFixed(0) + '%');

      },
    },

    series: [
      {
        name: '招标方式',
        type: 'pie',
        radius: ['30%', '80%'],

        itemStyle: {
          normal: {
            color: function (params) {
              return colorList[params.dataIndex];
            },
          },
        },
        label: {
          normal: {
            padding: [-30, -120],
            formatter: function (params) {

                return params.data.type + ':' + params.value + '个';

            },
            show: true,
          },
        },
        labelLine: {
          length: 30,
          length2:120,
        },
        labelLayout: {
          verticalAlign: "bottom",
          dy: -10,
        },
        data: data,
      },
    ],
};