1. option = {
    2. tooltip: { //设置浮窗----不需要可不要
    3. trigger: 'item', //默认则不需下面部分
    4. borderWidth: 3,
    5. padding: [10, 10, 10, 10],
    6. backgroundColor: '#fff',
    7. textStyle: {
    8. color: '#000'
    9. },
    10. formatter: function (params) {
    11. return (
    12. `${params.seriesName}<br/>` +
    13. `<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:${params.color};"></span>` +
    14. `${params.name}:${params.value}`
    15. );
    16. }
    17. },
    18. series: [
    19. {
    20. name: 'Access From',
    21. type: 'pie',
    22. // radius: ['0', '100%'], //[内半径,外半径];如果内半径有的话,就是环形图
    23. data: [
    24. { value: 1048, name: 'Search Engine', itemStyle: { color: '#f00' } },
    25. { value: 735, name: 'Direct', itemStyle: { color: '#f0f' } },
    26. { value: 580, name: 'Email', itemStyle: { color: '#0f0' } },
    27. { value: 484, name: 'Union Ads', itemStyle: { color: '#00f' } },
    28. { value: 300, name: 'Video Ads', itemStyle: { color: '#ff0' } }
    29. ],
    30. label: { //文本标签
    31. show: true,
    32. color: '#f00',
    33. fontSize: 20
    34. },
    35. labelLine: { //标签引线
    36. show: true,
    37. length: 30,
    38. length2: 30,
    39. smooth: true,
    40. },
    41. emphasis: { //高亮时的效果
    42. scale: true, //是否放大
    43. scaleSize: 10, //放大大小
    44. itemStyle: {
    45. shadowBlur: 10, //图形阴影的模糊大小
    46. shadowOffsetX: 0, //阴影水平方向上的偏移距离
    47. shadowColor: 'rgba(0, 0, 0, 0.5)', //阴影颜色
    48. opcity:0.3 //透明度
    49. }
    50. }
    51. }
    52. ]
    53. };