eventPieTh.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. function jkzb(zb_guiji, zb_gongxiang) {
  2. var myChart_eventPie = echarts.init(document.getElementById('jkzb'));
  3. option_eventPie = {
  4. color: ['#0ad5c8', '#89ca75'],
  5. tooltip: {
  6. trigger: 'item',
  7. formatter: '{a} <br/>{b}: {c} ({d}%)'
  8. },
  9. legend: {
  10. orient: 'horizontal',
  11. top: '160',
  12. left: 'center',
  13. data: ['归集接口', '共享接口'],
  14. textStyle: {
  15. fontSize: 12,
  16. color: '#00cdef'
  17. },
  18. },
  19. series: [
  20. {
  21. name: '接口占比',
  22. type: 'pie',
  23. center: ['50%', '40%'],
  24. radius: ['50%', '60%'],
  25. avoidLabelOverlap: false,
  26. label: {
  27. show: false,
  28. position: 'center'
  29. },
  30. emphasis: {
  31. label: {
  32. show: true,
  33. fontSize: '25',
  34. fontWeight: 'bold'
  35. }
  36. },
  37. labelLine: {
  38. show: false
  39. },
  40. data: [
  41. {value: zb_guiji, name: '归集接口'},
  42. {value: zb_gongxiang, name: '共享接口'},
  43. ],
  44. }
  45. ]
  46. };
  47. myChart_eventPie.setOption(option_eventPie);
  48. }