center22.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. function unit_score(data,data1){
  2. var myChart = echarts.init(document.getElementById('center22'), 'vintage');
  3. var option = {
  4. "color": ["#3cefff"],
  5. "tooltip": {},
  6. "grid": {
  7. "containLabel": true
  8. },
  9. "xAxis": [{
  10. "type": "category",
  11. "data": data,
  12. "axisTick": {
  13. "alignWithLabel": true
  14. },
  15. "nameTextStyle": {
  16. "color": "#fff"
  17. },
  18. "axisLine": {
  19. "lineStyle": {
  20. "color": "#fff"
  21. }
  22. },
  23. "axisLabel": {
  24. "textStyle": {
  25. "color": "#fff",
  26. "fontSize":8
  27. }
  28. }
  29. }],
  30. "yAxis": [{
  31. "type": "value",
  32. "axisLabel": {
  33. "textStyle": {
  34. "color": "#fff"
  35. },
  36. "formatter": "{value}"
  37. },
  38. "splitLine": {
  39. "lineStyle": {
  40. "color": "#0c2c5a"
  41. }
  42. },
  43. "axisLine": {
  44. "show": false
  45. }
  46. }],
  47. "series": [{
  48. "name": "",
  49. "type": "pictorialBar",
  50. "symbolSize": [30, 10],
  51. "symbolOffset": [0, -5],
  52. "symbolPosition": "end",
  53. "z": 12,
  54. "label": {
  55. "normal": {
  56. "show": true,
  57. "position": "top",
  58. "formatter": "{c}"
  59. }
  60. },
  61. "data": 102
  62. }, {
  63. "name": "",
  64. "type": "pictorialBar",
  65. "symbolSize": [30, 10],
  66. "symbolOffset": [0, 5],
  67. "z": 12,
  68. "data": data1
  69. }, {
  70. "type": "bar",
  71. "itemStyle": {
  72. "normal": {
  73. "opacity": 0.7
  74. }
  75. },
  76. "barWidth": "30",
  77. "data": 50,
  78. "markLine": {
  79. "silent": true,
  80. "symbol": "none",
  81. "label": {
  82. "position": "middle",
  83. "formatter": "{b}"
  84. },
  85. }
  86. },
  87. {
  88. type: 'effectScatter',
  89. silent: true,
  90. tooltip: {
  91. show: false
  92. },
  93. zlevel: 3,
  94. symbolSize:10,
  95. showEffectOn: 'render',
  96. rippleEffect: {
  97. brushType: 'stroke',
  98. color: '#3cefff',
  99. scale: 5
  100. },
  101. itemStyle: {
  102. color: '#3cefff'
  103. },
  104. hoverAnimation: true,
  105. data: [60,10,0,15,0,0,0,0]
  106. },
  107. ]
  108. }
  109. myChart.setOption(option);
  110. }