Explorar o código

百分比显示

PrinceLee %!s(int64=5) %!d(string=hai) anos
pai
achega
e357eb51b7
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/views/quality/defectStatistics.vue

+ 5 - 1
src/views/quality/defectStatistics.vue

@@ -397,7 +397,11 @@ export default {
           grid: { left: '0', right: '0', top: '3%', bottom: '0' },
           tooltip: { trigger: 'item', formatter: '{a} <br/>{b} : {c} ({d}%)' },
           legend: { orient: 'vertical', left: 'right', top: 'center', data: this.chart1Data.xaxis },
-          series: [{ name: '缺陷数量', type: 'pie', radius: ['45%', '60%'], right: '30%', label: { position: 'outer', alignTo: 'edge', margin: 20 }, data: newArr }
+          series: [
+            {
+              name: '缺陷数量', type: 'pie', radius: ['45%', '60%'], right: '30%', label: { position: 'outer', alignTo: 'edge', margin: 20 }, data: newArr,
+              itemStyle: { normal: { label: { show: true, formatter: '{b} : {c} ({d}%)' }, labelLine: { show: true }}}
+            }
           ]
         }
       }