码迷,mamicode.com
首页 > 其他好文 > 详细

圆环自定义样式(百分比)

时间:2021-07-01 17:27:43      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:log   normal   sel   data   百分比   label   font   ted   nbsp   

 

技术图片

 

 

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",
      ]
    };

  

圆环自定义样式(百分比)

标签:log   normal   sel   data   百分比   label   font   ted   nbsp   

原文地址:https://www.cnblogs.com/kkvt/p/14958753.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!