cokingCoalE.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. let app = new Vue({
  2. el: '#app',
  3. data () {
  4. return {
  5. config: {
  6. data: [18],
  7. shape: 'round',
  8. colors: ['#69C0FF', '#43EDE3']
  9. },
  10. companyList: [
  11. { name: '核心人力-1' },
  12. { name: '核心人力-2' },
  13. { name: '内部人才市场' },
  14. { name: '薪酬福利' },
  15. { name: '培训' }
  16. ]
  17. }
  18. },
  19. mounted () {
  20. setTimeout(() => {
  21. this.aiQualityECharts2();
  22. this.initChartR1()
  23. })
  24. },
  25. methods: {
  26. initChartR1 () {
  27. let myChart = echarts.init(this.$refs['echartR1'])
  28. let option = {
  29. tooltip: {
  30. trigger: 'item',
  31. },
  32. legend: {
  33. top: 'center',
  34. orient: 'vertical',
  35. left: '80%',
  36. textStyle: {
  37. color: '#9DB9EB',
  38. },
  39. },
  40. graphic: {
  41. elements: [{
  42. type: 'image',//需要填充图片,配置image,如果不需要图片可以配置其他的, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
  43. style: {
  44. image: './images/pie-back.png', //这里添加图片地址
  45. width: 180,
  46. height: 180
  47. },
  48. left: 'center',//
  49. top: 'middle' //配置图片居中
  50. }]
  51. // type: "text",
  52. // left: "center",
  53. // top: "45%",
  54. // style: {
  55. // text: "总人数2530",
  56. // textAlign: "center",
  57. // fill: "#fff",
  58. // fontSize: 20,
  59. // fontWeight: 700
  60. // }
  61. },
  62. series: [
  63. {
  64. name: '',
  65. type: 'pie',
  66. radius: ['50%', '60%'],
  67. labelLine: {
  68. normal: {
  69. lineStyle: {
  70. width: 1,
  71. },
  72. },
  73. },
  74. data: [
  75. { value: 1048, name: '教授' },
  76. { value: 735, name: '副教授' },
  77. { value: 580, name: '助教' },
  78. { value: 484, name: '讲师' },
  79. ],
  80. itemStyle: {
  81. normal: {
  82. color: function (colors) {
  83. var colorList = [
  84. '#00DCFF',
  85. '#116CFD',
  86. '#8BA2FF',
  87. '#FFC200'
  88. ];
  89. return colorList[colors.dataIndex];
  90. }
  91. },
  92. }
  93. },
  94. ],
  95. }
  96. myChart.setOption(option)
  97. tools.loopShowTooltip(myChart, option, {
  98. nterval: 2000,
  99. loopSeries: true,
  100. });
  101. },
  102. aiQualityECharts2 () {
  103. let chart = echarts.init(document.getElementById("aiQuality2"));
  104. let option = {
  105. grid: {
  106. top: 30,
  107. right: 40,
  108. left: 75,
  109. bottom: 50,
  110. },
  111. tooltip: {
  112. show: true,
  113. trigger: "axis",
  114. axisPointer: {
  115. // 坐标轴指示器,坐标轴触发有效
  116. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  117. },
  118. },
  119. xAxis: {
  120. data: ["集团本部", "山焦财务", "山焦担保", "山焦股份", "山焦国华", "山焦机电", "山焦人力", "山焦民爆", "山焦事业", "山焦投资"],
  121. axisTick: {
  122. show: false,
  123. },
  124. // x轴的字体颜色
  125. axisLabel: {
  126. interval: 0,
  127. rotate: 40,
  128. textStyle: {
  129. color: "white",
  130. },
  131. },
  132. //y轴线的颜色以及宽度
  133. axisLine: {
  134. show: true,
  135. lineStyle: {
  136. color: "#1E5389",
  137. width: 1,
  138. type: "solid",
  139. },
  140. },
  141. },
  142. yAxis: {
  143. axisTick: {
  144. lineStyle: {
  145. color: "#18416F",
  146. },
  147. },
  148. // y轴的字体颜色
  149. axisLabel: {
  150. textStyle: {
  151. color: "white",
  152. },
  153. },
  154. splitLine: {
  155. show: true,
  156. lineStyle: {
  157. color: "#204561",
  158. width: 1,
  159. type: "dotted",
  160. },
  161. },
  162. //y轴线的颜色以及宽度
  163. axisLine: {
  164. show: true,
  165. lineStyle: {
  166. color: "#1E5389",
  167. width: 1,
  168. type: "solid",
  169. },
  170. },
  171. },
  172. series: [
  173. {
  174. name: "",
  175. type: "bar",
  176. data: [1200, 680, 562, 268, 717, 843, 987, 126, 723, 569],
  177. showBackground: true,
  178. backgroundStyle: {
  179. color: "#18416F",
  180. },
  181. barWidth: "10%",
  182. itemStyle: {
  183. barBorderRadius: [10, 10, 0, 0],
  184. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  185. {
  186. offset: 0,
  187. color: "#02355C",
  188. }, //柱图渐变色
  189. {
  190. offset: 1,
  191. color: "#40A9FF",
  192. },
  193. ]),
  194. },
  195. }
  196. ],
  197. legend: {
  198. data: ["入池人数", "出池人数"],
  199. textStyle: {
  200. // 图列内容样式
  201. color: "#fff", // 字体颜色
  202. // fontSize: "10",
  203. },
  204. right: 30,
  205. icon: "roundRect",
  206. // 小图标的宽高
  207. itemHeight: 5,
  208. },
  209. };
  210. chart.setOption(option);
  211. tools.loopShowTooltip(chart, option, {
  212. nterval: 2000,
  213. loopSeries: true,
  214. });
  215. },
  216. },
  217. })