cokingCoalE.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. },
  98. aiQualityECharts2 () {
  99. let chart = echarts.init(document.getElementById("aiQuality2"));
  100. let option = {
  101. grid: {
  102. top: 30,
  103. right: 40,
  104. left: 75,
  105. bottom: 50,
  106. },
  107. tooltip: {
  108. show: true,
  109. trigger: "axis",
  110. axisPointer: {
  111. // 坐标轴指示器,坐标轴触发有效
  112. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  113. },
  114. },
  115. xAxis: {
  116. data: ["集团本部", "山焦财务", "山焦担保", "山焦股份", "山焦国华", "山焦机电", "山焦人力", "山焦民爆", "山焦事业", "山焦投资"],
  117. axisTick: {
  118. show: false,
  119. },
  120. // x轴的字体颜色
  121. axisLabel: {
  122. interval: 0,
  123. rotate: 40,
  124. textStyle: {
  125. color: "white",
  126. },
  127. },
  128. //y轴线的颜色以及宽度
  129. axisLine: {
  130. show: true,
  131. lineStyle: {
  132. color: "#1E5389",
  133. width: 1,
  134. type: "solid",
  135. },
  136. },
  137. },
  138. yAxis: {
  139. axisTick: {
  140. lineStyle: {
  141. color: "#18416F",
  142. },
  143. },
  144. // y轴的字体颜色
  145. axisLabel: {
  146. textStyle: {
  147. color: "white",
  148. },
  149. },
  150. splitLine: {
  151. show: true,
  152. lineStyle: {
  153. color: "#204561",
  154. width: 1,
  155. type: "dotted",
  156. },
  157. },
  158. //y轴线的颜色以及宽度
  159. axisLine: {
  160. show: true,
  161. lineStyle: {
  162. color: "#1E5389",
  163. width: 1,
  164. type: "solid",
  165. },
  166. },
  167. },
  168. series: [
  169. {
  170. name: "",
  171. type: "bar",
  172. data: [1200, 680, 562, 268, 717, 843, 987, 126, 723, 569],
  173. showBackground: true,
  174. backgroundStyle: {
  175. color: "#18416F",
  176. },
  177. barWidth: "10%",
  178. itemStyle: {
  179. barBorderRadius: [10, 10, 0, 0],
  180. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  181. {
  182. offset: 0,
  183. color: "#02355C",
  184. }, //柱图渐变色
  185. {
  186. offset: 1,
  187. color: "#40A9FF",
  188. },
  189. ]),
  190. },
  191. }
  192. ],
  193. legend: {
  194. data: ["入池人数", "出池人数"],
  195. textStyle: {
  196. // 图列内容样式
  197. color: "#fff", // 字体颜色
  198. // fontSize: "10",
  199. },
  200. right: 30,
  201. icon: "roundRect",
  202. // 小图标的宽高
  203. itemHeight: 5,
  204. },
  205. };
  206. chart.setOption(option);
  207. tools.loopShowTooltip(chart, option, {
  208. nterval: 2000,
  209. loopSeries: true,
  210. });
  211. },
  212. },
  213. })