需要显示的最终效果及可以实现的代码;位置可能会有点对不上,可以根据自己的需求调整;这个解决了默认显示lable时的遮盖问题以及很奇怪的默认显示最大项问题;代码写的不怎么好,别见怪
<template>
<div ref="chart" class="chart" />
</template>
<script>
import * as echarts from 'echarts';
import xxx from 'xxx'//地址接口
export default {
data() {
return {
chart: null,
option: {
title: {
text: '完成情况',
subtext: '',
left: '3%',
top: '5%',
textStyle: { color: '#0A2A4D' },
subtextStyle: {
color: '#0A2A4D',
lineHeight: 20,
fontSize: 16
}
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: { bottom: 'bottom', icon: 'square' },
series: [
{
name: '病例收集完成情况',
type: 'pie',