option = { tooltip: { trigger: 'item', formatter: "{a} <br/>{b}: {c} ({d}%)", }, legend: { orient: 'horizontal', y: 'top', data: ['幼稚园', '小学生', '初中生', '高中生', '大专生', '本科生', '硕士', '博士', '博士后'], }, series: [{ name: '访问来源', type: 'pie', radius: ['50%', '70%'], avoidLabelOverlap: false, label: { normal: { show: false, position: 'center' }, emphasis: { show: true, position: 'center', textStyle: { fontSize: '20', fontWeight: 'bold' } } }, labelLine: { normal: { show: false, } }, data: [{ value: 3100, name: '小学生', itemStyle: { normal: { color: '#E3E3E3' } }, }, { value: 2340, name: '初中生', itemStyle: { normal: { color: '#9b9b9b' } } }, { value: 1350, name: '高中生', itemStyle: { normal: { color: '#434343' } } }, { value: 1200, name: '大专生', itemStyle: { normal: { color: '#8E8E38' } } }, { value: 1000, name: '本科生', itemStyle: { normal: { color: '#CDAD00' } } }, { value: 800, name: '硕士', itemStyle: { normal: { color: '#eac85a' } } }, { value: 600, name: '博士', itemStyle: { normal: { color: '#FFD700' } } }, { value: 200, name: '博士后', itemStyle: { normal: { color: '#FFEC8B' } } }, ] }] }; myChart.setOption(option);