Oracimaru commented on issue #16917:
URL: https://github.com/apache/echarts/issues/16917#issuecomment-1103455436

     let option = {
                   title: {
                       text: '',
                       left: 'center',
                       top: 'center'
                   },
                   series: [{
                           type: 'pie',
                           color: ['#FEC441', '#58C087', '#FF7D00', 
'#0197FF','#800000'],//'#65E6F1'
                           // silent:true,
                           clickable: false,
                           avoidLabelOverlap: true,   //是否启用防止标签重叠策略
                           hoverAnimation: false,
                           minAngle: 20,
                           itemStyle: {
                               normal: {
                                   label: {
                                       show: true,
                                       position: 'inner',
                                       // formatter: '{d}%',
                                       formatter: function (obj) {
                                           console.log('obj===',obj)
                                           return  obj.percent.toFixed(0) + '%'
                                       },
                                       distance: 100, //这项是标识距离中心点的距离
                                       color:'#000',
                                       padding:[0,-5,0,0],
                                       textStyle: {
                                           align: 'center',
                                           baseline: 'middle',
                                           fontSize: 12,
                                           fontWeight: 800
                                       }
                                   },
                                   labelLine:{
                                       show : false,
                                   }
                               }
                           },
                           data: [
   
                               {
                                   value: this.getPercent('A'),//10,
                                   name: 'A'
                               },
                               {
                                   value: this.getPercent('B'),//15,
                                   name: 'B'
                               },
                               {
                                   value: this.getPercent('C'),//20,
                                   name: 'C'
                               },
                               {
                                   value:this.getPercent('D'),// 40,
                                   name: 'D'
                               },
                               {
                                   value: this.getPercent('E'),//15,
                                   name: 'E'
                               },
                           ],
                           radius: ['15%', '32%']
                       },
                   ]
               };


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to