recruit.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. $(function() {
  2. function createBar2() {
  3. var chartDom = document.getElementById('main2');
  4. var myChart = echarts.init(chartDom);
  5. var option;
  6. option = {
  7. legend: {
  8. top:300,
  9. left:20,
  10. textStyle:{
  11. fontSize: 16,
  12. color: '#fff',
  13. },
  14. data: ['入场人数', '浏览人数', '投递人数']
  15. },
  16. color: [
  17. '#4e6eac',
  18. '#6895f7',
  19. '#8aadf9',
  20. ],
  21. xAxis: { show: false },
  22. yAxis: { show: false, type: 'category', inverse: true, min: 0, max: 6 },
  23. series: [
  24. {
  25. type: 'funnel',
  26. minSize: 50,
  27. maxSize: '100%',
  28. left: '4%',
  29. top: 0,
  30. bottom: 50,
  31. gap: 2,
  32. label: {
  33. position: 'inside',
  34. fontFamily: 'Microsoft YaHei',
  35. fontSize: 16,
  36. color: '#fff',
  37. formatter: '{c}%',
  38. rich: { xx: { padding: [6, 0] } }
  39. },
  40. data: [
  41. { value: 100, name: '入场人数' },
  42. { value: 80, name: '浏览人数' },
  43. { value: 20, name: '投递人数' },
  44. ]
  45. },
  46. ]
  47. };
  48. option && myChart.setOption(option);
  49. }
  50. function createBar3() {
  51. var chartDom = document.getElementById('main3');
  52. var myChart = echarts.init(chartDom);
  53. var option;
  54. option = {
  55. tooltip: {
  56. trigger: 'axis'
  57. },
  58. grid:{
  59. x:50,y:30,x2:40,y2:30,
  60. },
  61. textStyle: {
  62. color: '#cccccc',
  63. fontSize: 20
  64. },
  65. xAxis: {
  66. type: 'category',
  67. boundaryGap: false,
  68. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Sun2',]
  69. },
  70. yAxis: {
  71. type: 'value',
  72. },
  73. series: [
  74. {
  75. data: [null,120, 932, 901, 934, 1290, 1330, 1320],
  76. type: 'line',
  77. areaStyle: {}
  78. }
  79. ]
  80. };
  81. option && myChart.setOption(option);
  82. }
  83. function createBar4() {
  84. var chartDom = document.getElementById('main4');
  85. var myChart = echarts.init(chartDom);
  86. var option;
  87. option = {
  88. textStyle: {
  89. color: '#cccccc',
  90. fontSize: 20
  91. },
  92. grid: {
  93. left: '3%',
  94. right: '4%',
  95. bottom: '3%',
  96. containLabel: true
  97. },
  98. xAxis: {
  99. type: 'category',
  100. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  101. },
  102. yAxis: {
  103. type: 'value'
  104. },
  105. series: [
  106. {
  107. data: [120, 200, 150, 80, 70, 110, 130],
  108. type: 'bar'
  109. }
  110. ]
  111. };
  112. option && myChart.setOption(option);
  113. }
  114. function createBar1(title, data, clickEvent) {
  115. var chartDom = document.getElementById('main1');
  116. var myChart = echarts.init(chartDom);
  117. var option;
  118. option = {
  119. title:[
  120. {
  121. text: '求职者性别分布',
  122. left:'8%',//居中显示
  123. top:'80%',//底部显示
  124. textStyle: {
  125. color: '#cccccc',
  126. fontSize: 20
  127. }
  128. },
  129. {
  130. text: '求职者年龄分布',
  131. left:'43%',//居中显示
  132. top:'80%',//底部显示
  133. textStyle: {
  134. color: '#cccccc',
  135. fontSize: 20
  136. }
  137. },
  138. {
  139. text: '求职者学历分布',
  140. left:'73%',//居中显示
  141. top:'80%',//底部显示
  142. textStyle: {
  143. color: '#cccccc',
  144. fontSize: 20
  145. }
  146. }],
  147. dataset: [
  148. {
  149. source: [
  150. ['Product', 'Sales', 'Price', 'Year'],
  151. ['啊大', 123, 32, 2011],
  152. ['中砂', 231, 14, 2011],
  153. ['豆腐', 235, 5, 2011],
  154. ['米有', 341, 25, 2011],
  155. ['碧霞', 122, 29, 2011],
  156. ['啊大', 143, 30, 2012],
  157. ['中砂', 201, 19, 2012],
  158. ['豆腐', 255, 7, 2012],
  159. ['米有', 241, 27, 2012],
  160. ['碧霞', 102, 34, 2012],
  161. ['啊大', 153, 28, 2013],
  162. ['中砂', 181, 21, 2013],
  163. ['豆腐', 395, 4, 2013],
  164. ['米有', 281, 31, 2013],
  165. ['碧霞', 92, 39, 2013],
  166. ['啊大', 223, 29, 2014],
  167. ['中砂', 211, 17, 2014],
  168. ['豆腐', 345, 3, 2014],
  169. ['米有', 211, 35, 2014],
  170. ['碧霞', 72, 24, 2014]
  171. ]
  172. },
  173. {
  174. transform: {
  175. type: 'filter',
  176. config: { dimension: 'Year', value: 2011 }
  177. }
  178. },
  179. {
  180. transform: {
  181. type: 'filter',
  182. config: { dimension: 'Year', value: 2012 }
  183. }
  184. },
  185. {
  186. transform: {
  187. type: 'filter',
  188. config: { dimension: 'Year', value: 2013 }
  189. }
  190. }
  191. ],
  192. series: [
  193. {
  194. type: 'pie',
  195. label: {
  196. normal: {
  197. textStyle : {
  198. color: '#cccccc',
  199. fontSize : '12px'
  200. },
  201. },
  202. },
  203. radius:[40, 60],
  204. datasetIndex: 1
  205. },
  206. {
  207. label: {
  208. normal: {
  209. textStyle : {
  210. color: '#cccccc',
  211. fontSize : '12px'
  212. },
  213. },
  214. },
  215. type: 'pie',
  216. radius:[40, 60],
  217. datasetIndex: 2
  218. },
  219. {
  220. label: {
  221. normal: {
  222. textStyle : {
  223. color: '#cccccc',
  224. fontSize : '12px'
  225. },
  226. },
  227. },
  228. type: 'pie',
  229. radius:[40, 60],
  230. datasetIndex: 3
  231. }
  232. ],
  233. // Optional. Only for responsive layout:
  234. media: [
  235. {
  236. query: { minAspectRatio: 1 },
  237. option: {
  238. series: [
  239. { center: ['18%', '50%'] },
  240. { center: ['50%', '50%'] },
  241. { center: ['82%', '50%'] }
  242. ]
  243. }
  244. },
  245. {
  246. option: {
  247. series: [
  248. { center: ['50%', '25%'] },
  249. { center: ['50%', '50%'] },
  250. { center: ['50%', '75%'] }
  251. ]
  252. }
  253. }
  254. ]
  255. };
  256. option && myChart.setOption(option);
  257. }
  258. createBar1();
  259. createBar2();
  260. createBar3();
  261. createBar4();
  262. })