test

博客园 首页 新随笔 联系 订阅 管理

 

 

 

option = {

      legend: {
        show: false
      },
      series: [
        {
          type: "pie",
          radius: [0, 0],

          silent: true,
          label: {
            normal: {
              show: true,
              position: "center",
              formatter: item => {
                return `{a|test}\n{p|}\n{b|123}{pre|人}`;
              },
              rich: {
                a: {
                  fontSize: 24,
                  color: "rgba(0,0,0,0.45)"
                },
                p: {
                  width: "100%",
                  height: 24
                },
                b: {
                  fontSize: 48,
                  color: "rgba(0,0,0,0.85)"
                },
                pre: {
                  fontSize: 24,
                  color: "rgba(0,0,0,0.45)"
                }
              }
            },
            emphasis: {
              show: false
            }
          },
          data: [{ value: 0, name: "", selected: true }]
        },
        {
          type: "pie",
          radius: ["35%", "60%"],
          label: {
            align: "left",
            formatter: item => {
                console.log(item);
              let { name,  value } = item;
             let percent = item.data.value1;
             if(name=="处理量")
              return `{text|${name}:} {value|${value}} \n{text|处理率:}{value|${percent}%}`;
              else
              return "";
            },
            rich: {
               
                text: {
                  fontSize: 24,
                  color: "#70798C"
                },
                value: {
                  fontSize: 24,
                  color: "#2B91FF"
                }
              },
                      
            fontSize:16,
            color: "rgba(0,0,0,.65)"
          },

          data: [
                {value: 55,value1:2122, name: '处理量'},
                {value:45, name: 'cccc'},
          
            ],
            labelLine: {
            normal: {
              show: true,
              formatter: item => {
                  console.log(item);
              return null;
            },
            }
          },
        },
          
      ],
      color: [
        "#EBEEF2",
        "#1890FF",
      ]
    };

  

posted on 2021-07-01 14:55  testgogogo  阅读(75)  评论(0编辑  收藏  举报