pinhuan.js 942 B

123456789101112131415161718192021222324252627282930313233343536
  1. (function () {
  2. 'use strict';
  3. var myChart = echarts.init(document.getElementById('left-bottom-nong'));
  4. // 指定图表的配置项和数据
  5. var option = {
  6. tooltip: {},
  7. series: [{
  8. name: '销量',
  9. type: 'pie',
  10. radius: ['30%', '60%'],
  11. right: '20%',
  12. data: [{
  13. value: 200,
  14. name: '在线',
  15. itemStyle: {
  16. color: '#5ba3ed'
  17. }
  18. },
  19. {
  20. value: 30,
  21. name: '不在线',
  22. itemStyle: {
  23. color: '#a0fffe'
  24. }
  25. },
  26. ]
  27. }]
  28. };
  29. // 使用刚指定的配置项和数据显示图表。
  30. myChart.setOption(option);
  31. window.addEventListener('resize',function(){
  32. myChart.resize();
  33. })
  34. })()