option = { tooltip: { //设置浮窗----不需要可不要 trigger: 'item', //默认则不需下面部分 borderWidth: 3, padding: [10, 10, 10, 10], backgroundColor: '#fff', textStyle: { color: '#000' }, formatter: function (params) { return ( `${params.seriesName}<br/>` + `<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:${params.color};"></span>` + `${params.name}:${params.value}` ); } }, series: [ { name: 'Access From', type: 'pie', // radius: ['0', '100%'], //[内半径,外半径];如果内半径有的话,就是环形图 data: [ { value: 1048, name: 'Search Engine', itemStyle: { color: '#f00' } }, { value: 735, name: 'Direct', itemStyle: { color: '#f0f' } }, { value: 580, name: 'Email', itemStyle: { color: '#0f0' } }, { value: 484, name: 'Union Ads', itemStyle: { color: '#00f' } }, { value: 300, name: 'Video Ads', itemStyle: { color: '#ff0' } } ], label: { //文本标签 show: true, color: '#f00', fontSize: 20 }, labelLine: { //标签引线 show: true, length: 30, length2: 30, smooth: true, }, emphasis: { //高亮时的效果 scale: true, //是否放大 scaleSize: 10, //放大大小 itemStyle: { shadowBlur: 10, //图形阴影的模糊大小 shadowOffsetX: 0, //阴影水平方向上的偏移距离 shadowColor: 'rgba(0, 0, 0, 0.5)', //阴影颜色 opcity:0.3 //透明度 } } } ]};