例://中心文字数据var data;@if(($manual_visit+$finish_visit)!=0) data ='回访率\n'+ '{ { number_format(($manual_visit+$finish_visit)/($manual_visit+$finish_visit+$not_connect+$not_visit)*100,2) }}'+ '%';@else data ='回访率\n0%';@endif
var manual_visit = "{ { $manual_visit }}";var finish_visit = "{ { $finish_visit }}";var not_connect = "{ { $not_connect }}";var not_visit = "{ { $not_visit }}";var myCharts1 = echarts.init(document.getElementById('cake'));var option1 = { backgroundColor: 'white', tooltip: { trigger: 'item', formatter: "{b} :{c}个 ({d}%)" }, legend: { orient: 'vertical', x: '75%', y: '30%', itemWidth: 10, itemHeight: 10, itemGap: 30, data: [ { name: "手动回访", icon: "circle", textStyle: { fontSize: '14' } }, { name: "已回访", icon: "circle", textStyle: { fontSize: '14' } }, { name: "未接通", icon: "circle", textStyle: { fontSize: '14' } }, { name: "未回访", icon: "circle", textStyle: { fontSize: '14' } } ] }, series: [ { name: '回访数据', type: 'pie', avoidLabelOverlap: false, radius: ['42%', '70%'], center: ['40%', '50%'], label: { normal: { show: true, position: 'center', formatter(){ return data; }, color:"#4ecb73", fontSize:22 }, }, labelLine: { normal: { show: false } }, data: [ { value: manual_visit, name: '手动回访', itemStyle: { normal: { color: '#4bdbac' } } }, { value: finish_visit, name: '已回访', itemStyle: { normal: { color: '#4ecb73' } } }, { value: not_connect, name: '未接通', itemStyle: { normal: { color: '#ff7c7c' } } }, { value: not_visit, name: '未回访', itemStyle: { normal: { color: '#f2637b' } } } ], } ]};myCharts1.setOption(option1);