cokingCoalE.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. right: '2%',
  36. textStyle: {
  37. color: '#9DB9EB',
  38. },
  39. },
  40. graphic: {
  41. type: "text",
  42. left: "center",
  43. top: "45%",
  44. style: {
  45. text: "总人数2530",
  46. textAlign: "center",
  47. fill: "#fff",
  48. fontSize: 20,
  49. fontWeight: 700
  50. }
  51. },
  52. series: [
  53. {
  54. name: '',
  55. type: 'pie',
  56. radius: ['55%', '80%'],
  57. labelLine: {
  58. normal: {
  59. lineStyle: {
  60. width: 1,
  61. },
  62. },
  63. },
  64. data: [
  65. { value: 1048, name: '教授' },
  66. { value: 735, name: '副教授' },
  67. { value: 580, name: '助教' },
  68. { value: 484, name: '讲师' },
  69. ],
  70. itemStyle: {
  71. normal: {
  72. color: function (colors) {
  73. var colorList = [
  74. '#00DCFF',
  75. '#116CFD',
  76. '#8BA2FF',
  77. '#FFC200'
  78. ];
  79. return colorList[colors.dataIndex];
  80. }
  81. },
  82. }
  83. },
  84. ],
  85. }
  86. myChart.setOption(option)
  87. },
  88. aiQualityECharts2 () {
  89. let chart = echarts.init(document.getElementById("aiQuality2"));
  90. let option = {
  91. grid: {
  92. top: 30,
  93. right: 40,
  94. left: 75,
  95. bottom: 50,
  96. },
  97. tooltip: {
  98. show: true,
  99. trigger: "axis",
  100. axisPointer: {
  101. // 坐标轴指示器,坐标轴触发有效
  102. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  103. },
  104. },
  105. xAxis: {
  106. data: ["集团本部", "山焦财务", "山焦担保", "山焦股份", "山焦国华", "山焦机电", "山焦人力", "山焦民爆", "山焦事业", "山焦投资"],
  107. axisTick: {
  108. show: false,
  109. },
  110. // x轴的字体颜色
  111. axisLabel: {
  112. interval: 0,
  113. rotate: 40,
  114. textStyle: {
  115. color: "white",
  116. },
  117. },
  118. //y轴线的颜色以及宽度
  119. axisLine: {
  120. show: true,
  121. lineStyle: {
  122. color: "#1E5389",
  123. width: 1,
  124. type: "solid",
  125. },
  126. },
  127. },
  128. yAxis: {
  129. axisTick: {
  130. lineStyle: {
  131. color: "#18416F",
  132. },
  133. },
  134. // y轴的字体颜色
  135. axisLabel: {
  136. textStyle: {
  137. color: "white",
  138. },
  139. },
  140. splitLine: {
  141. show: true,
  142. lineStyle: {
  143. color: "#204561",
  144. width: 1,
  145. type: "dotted",
  146. },
  147. },
  148. //y轴线的颜色以及宽度
  149. axisLine: {
  150. show: true,
  151. lineStyle: {
  152. color: "#1E5389",
  153. width: 1,
  154. type: "solid",
  155. },
  156. },
  157. },
  158. series: [
  159. {
  160. name: "",
  161. type: "bar",
  162. data: [1200, 680, 562, 268, 717, 843, 987, 126, 723, 569],
  163. showBackground: true,
  164. backgroundStyle: {
  165. color: "#18416F",
  166. },
  167. barWidth: "10%",
  168. itemStyle: {
  169. barBorderRadius: [10, 10, 0, 0],
  170. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  171. {
  172. offset: 0,
  173. color: "#02355C",
  174. }, //柱图渐变色
  175. {
  176. offset: 1,
  177. color: "#40A9FF",
  178. },
  179. ]),
  180. },
  181. }
  182. ],
  183. legend: {
  184. data: ["入池人数", "出池人数"],
  185. textStyle: {
  186. // 图列内容样式
  187. color: "#fff", // 字体颜色
  188. // fontSize: "10",
  189. },
  190. right: 30,
  191. icon: "roundRect",
  192. // 小图标的宽高
  193. itemHeight: 5,
  194. },
  195. };
  196. chart.setOption(option);
  197. tools.loopShowTooltip(chart, option, {
  198. nterval: 2000,
  199. loopSeries: true,
  200. });
  201. },
  202. },
  203. })