tooltip: {
		formatter: (params) => {
			if (params.name !== '') {
				return params.name + ' : '  + '\n' + '' + params.percent + '%';
			}
		},
	},

下面是完整代码


var piedom7 = document.getElementById("Echart7");
var piedChart7 = echarts.init(piedom7);
pieoption7 = {
	title:{
		show:true, 
		text: '电子银行',
		x:'center',
		y: 'bottom',
		textStyle: { 
			fontSize: 16,
			fontStyle: 'normal',
			fontWeight: 'normal',
		},
	},
	tooltip: {
		formatter: (params) => {
			if (params.name !== '') {
				return params.name + ' : '  + '\n' + '' + params.percent + '%';
			}
		},
	},
	series: [{
		type: 'pie',
		center: ['50%', '45%'],
		radius: '76%',
		clockwise: true,
		avoidLabelOverlap: true,
		hoverOffset: 10,
		startAngle:170, 
		emphasis: {},
		itemStyle: {
			normal: {borderWidth: 2,//
				borderColor: '#ffffff',
				color: function(params) {
					var colorList = ['#FEB03A', '#1693F1']
					return colorList[params.dataIndex]
				}
			}
		},
		label: {
			show: false,
			textStyle: {
				fontSize: 12,
				padding: [-15, -30, 0, -30],
			}
		},
		labelLine: {
			normal: {
				length: 20,
				length2: 50,
				lineStyle: {
					width: 1
				}
			}
		},
		data: [{
			'name': '商机未成功营销率',
			'value': 10,
		}, {
			'name': '商机成功营销率',
			'value': 90
		},],
	}]
}
if (pieoption7 && typeof pieoption7 === "object") {
	piedChart7.clear();
	piedChart7.resize();
	piedChart7.setOption(pieoption7, true);
};

By lxcss

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注