You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

section_1.js 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. $(function () {
  2. function initAverageScoreEcharts() {
  3. var itemStyle = {
  4. normal: {
  5. label: {
  6. show: true, //开启显示数值
  7. position: "top" //数值在上方显示
  8. }
  9. }
  10. };
  11. var xAxis_data = ["一般", "二班"]
  12. var curlegend = ["满分", "最高分", "最低分", "平均分"];
  13. var curseries = [{
  14. name: "满分",
  15. type: "bar",
  16. barWidth: $.UnitUtil.mm2px(5),
  17. // 柱状图最小高度
  18. barMinHeight: $.UnitUtil.mm2px(2),
  19. barGap: 0,
  20. data: [60, 70],
  21. itemStyle: itemStyle
  22. },
  23. {
  24. name: "最高分",
  25. type: "bar",
  26. barWidth: $.UnitUtil.mm2px(5),
  27. // 柱状图最小高度
  28. barMinHeight: $.UnitUtil.mm2px(2),
  29. barGap: 0,
  30. data: [50, 60],
  31. itemStyle: itemStyle
  32. },
  33. {
  34. name: "最低分",
  35. type: "bar",
  36. barWidth: $.UnitUtil.mm2px(5),
  37. // 柱状图最小高度
  38. barMinHeight: $.UnitUtil.mm2px(2),
  39. barGap: 0,
  40. data: [30, 40],
  41. itemStyle: itemStyle
  42. },
  43. {
  44. name: "平均分",
  45. type: "bar",
  46. barWidth: $.UnitUtil.mm2px(5),
  47. // 柱状图最小高度
  48. barMinHeight: $.UnitUtil.mm2px(2),
  49. barGap: 0,
  50. data: [40, 50],
  51. itemStyle: itemStyle
  52. }
  53. ];
  54. var option = {
  55. animation: false,
  56. color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
  57. title: {
  58. text: "分",
  59. x: "left",
  60. y: "top",
  61. textStyle: {
  62. color: "#5F6E82",
  63. fontSize: $.UnitUtil.mm2px(3),
  64. fontWeight: 500
  65. }
  66. },
  67. legend: {
  68. itemWidth: $.UnitUtil.mm2px(2),
  69. itemHeight: $.UnitUtil.mm2px(2),
  70. top: "bottom",
  71. data: curlegend
  72. },
  73. grid: {
  74. top: $.UnitUtil.mm2px(10),
  75. left: 0,
  76. right: 0,
  77. bottom: $.UnitUtil.mm2px(8),
  78. containLabel: true,
  79. },
  80. xAxis: [{
  81. type: "category",
  82. data: xAxis_data,
  83. axisLabel: {
  84. color: "#5F6E82" //更改坐标轴文字颜色
  85. },
  86. axisTick: {
  87. alignWithLabel: true
  88. },
  89. boundaryGap: true,
  90. triggerEvent: true,
  91. axisLine: {
  92. show: true, //是否显示轴线
  93. lineStyle: {
  94. color: "#DADADA" //刻度线的颜色
  95. }
  96. }
  97. }],
  98. yAxis: [{
  99. type: "value",
  100. axisTick: {
  101. show: false //刻度
  102. },
  103. axisLine: {
  104. show: false, //是否显示轴线
  105. lineStyle: {
  106. color: "#DADADA" //刻度线的颜色
  107. }
  108. },
  109. splitLine: {
  110. //网格线
  111. lineStyle: {
  112. type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
  113. },
  114. show: true //隐藏或显示
  115. },
  116. axisLabel: {
  117. color: "#5F6E82" //更改坐标轴文字颜色
  118. }
  119. }],
  120. series: curseries
  121. };
  122. var myEcharts = echarts.init(document.querySelector(".section1 #averagescoreEcharts"));
  123. myEcharts.clear();
  124. myEcharts.setOption(option);
  125. }
  126. function initExcellenceRateEcharts() {
  127. var itemStyle = {
  128. normal: {
  129. label: {
  130. show: true, //开启显示数值
  131. position: "top" //数值在上方显示
  132. }
  133. }
  134. };
  135. var xAxis_data = ["一般", "二班"]
  136. var curlegend = ["优秀率", "良好率", "及格率", "低分率"];
  137. var curseries = [{
  138. name: "优秀率",
  139. type: "bar",
  140. barWidth: $.UnitUtil.mm2px(5),
  141. // 柱状图最小高度
  142. barMinHeight: $.UnitUtil.mm2px(2),
  143. barGap: 0,
  144. data: [60, 70],
  145. itemStyle: itemStyle
  146. },
  147. {
  148. name: "良好率",
  149. type: "bar",
  150. barWidth: $.UnitUtil.mm2px(5),
  151. // 柱状图最小高度
  152. barMinHeight: $.UnitUtil.mm2px(2),
  153. barGap: 0,
  154. data: [50, 60],
  155. itemStyle: itemStyle
  156. },
  157. {
  158. name: "及格率",
  159. type: "bar",
  160. barWidth: $.UnitUtil.mm2px(5),
  161. // 柱状图最小高度
  162. barMinHeight: $.UnitUtil.mm2px(2),
  163. barGap: 0,
  164. data: [30, 40],
  165. itemStyle: itemStyle
  166. },
  167. {
  168. name: "低分率",
  169. type: "bar",
  170. barWidth: $.UnitUtil.mm2px(5),
  171. // 柱状图最小高度
  172. barMinHeight: $.UnitUtil.mm2px(2),
  173. barGap: 0,
  174. data: [40, 50],
  175. itemStyle: itemStyle
  176. }
  177. ];
  178. var option = {
  179. animation: false,
  180. color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
  181. title: {
  182. text: "分",
  183. x: "left",
  184. y: "top",
  185. textStyle: {
  186. color: "#5F6E82",
  187. fontSize: $.UnitUtil.mm2px(3),
  188. fontWeight: 500
  189. }
  190. },
  191. legend: {
  192. itemWidth: $.UnitUtil.mm2px(2),
  193. itemHeight: $.UnitUtil.mm2px(2),
  194. top: "bottom",
  195. data: curlegend
  196. },
  197. grid: {
  198. top: $.UnitUtil.mm2px(10),
  199. left: 0,
  200. right: 0,
  201. bottom: $.UnitUtil.mm2px(8),
  202. containLabel: true,
  203. },
  204. xAxis: [{
  205. type: "category",
  206. data: xAxis_data,
  207. axisLabel: {
  208. color: "#5F6E82" //更改坐标轴文字颜色
  209. },
  210. axisTick: {
  211. alignWithLabel: true
  212. },
  213. boundaryGap: true,
  214. triggerEvent: true,
  215. axisLine: {
  216. show: true, //是否显示轴线
  217. lineStyle: {
  218. color: "#DADADA" //刻度线的颜色
  219. }
  220. }
  221. }],
  222. yAxis: [{
  223. type: "value",
  224. axisTick: {
  225. show: false //刻度
  226. },
  227. axisLine: {
  228. show: false, //是否显示轴线
  229. lineStyle: {
  230. color: "#DADADA" //刻度线的颜色
  231. }
  232. },
  233. splitLine: {
  234. //网格线
  235. lineStyle: {
  236. type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
  237. },
  238. show: true //隐藏或显示
  239. },
  240. axisLabel: {
  241. color: "#5F6E82" //更改坐标轴文字颜色
  242. }
  243. }],
  244. series: curseries
  245. };
  246. var myEcharts = echarts.init(document.querySelector(".section1 #excellencerateEcharts"));
  247. myEcharts.clear();
  248. myEcharts.setOption(option);
  249. }
  250. function initExamnumEcharts() {
  251. var itemStyle = {
  252. normal: {
  253. label: {
  254. show: true, //开启显示数值
  255. position: "top" //数值在上方显示
  256. }
  257. }
  258. };
  259. var xAxis_data = ["一般", "二班"]
  260. var curlegend = ["实考人数", "缺考人数"];
  261. var curseries = [{
  262. name: "实考人数",
  263. type: "bar",
  264. barWidth: $.UnitUtil.mm2px(5),
  265. // 柱状图最小高度
  266. barMinHeight: $.UnitUtil.mm2px(2),
  267. barGap: 0,
  268. data: [60, 70],
  269. itemStyle: itemStyle
  270. },
  271. {
  272. name: "缺考人数",
  273. type: "bar",
  274. barWidth: $.UnitUtil.mm2px(5),
  275. // 柱状图最小高度
  276. barMinHeight: $.UnitUtil.mm2px(2),
  277. barGap: 0,
  278. data: [50, 60],
  279. itemStyle: itemStyle
  280. }
  281. ];
  282. var option = {
  283. animation: false,
  284. color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
  285. title: {
  286. text: "分",
  287. x: "left",
  288. y: "top",
  289. textStyle: {
  290. color: "#5F6E82",
  291. fontSize: $.UnitUtil.mm2px(3),
  292. fontWeight: 500
  293. }
  294. },
  295. legend: {
  296. itemWidth: $.UnitUtil.mm2px(2),
  297. itemHeight: $.UnitUtil.mm2px(2),
  298. top: "bottom",
  299. data: curlegend
  300. },
  301. grid: {
  302. top: $.UnitUtil.mm2px(10),
  303. left: 0,
  304. right: 0,
  305. bottom: $.UnitUtil.mm2px(8),
  306. containLabel: true,
  307. },
  308. xAxis: [{
  309. type: "category",
  310. data: xAxis_data,
  311. axisLabel: {
  312. color: "#5F6E82" //更改坐标轴文字颜色
  313. },
  314. axisTick: {
  315. alignWithLabel: true
  316. },
  317. boundaryGap: true,
  318. triggerEvent: true,
  319. axisLine: {
  320. show: true, //是否显示轴线
  321. lineStyle: {
  322. color: "#DADADA" //刻度线的颜色
  323. }
  324. }
  325. }],
  326. yAxis: [{
  327. type: "value",
  328. axisTick: {
  329. show: false //刻度
  330. },
  331. axisLine: {
  332. show: false, //是否显示轴线
  333. lineStyle: {
  334. color: "#DADADA" //刻度线的颜色
  335. }
  336. },
  337. splitLine: {
  338. //网格线
  339. lineStyle: {
  340. type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
  341. },
  342. show: true //隐藏或显示
  343. },
  344. axisLabel: {
  345. color: "#5F6E82" //更改坐标轴文字颜色
  346. }
  347. }],
  348. series: curseries
  349. };
  350. var myEcharts = echarts.init(document.querySelector(".section1 #examnumEcharts"));
  351. myEcharts.clear();
  352. myEcharts.setOption(option);
  353. }
  354. function initbzcEcharts() {
  355. var itemStyle = {
  356. normal: {
  357. label: {
  358. show: true, //开启显示数值
  359. position: "top" //数值在上方显示
  360. }
  361. }
  362. };
  363. var xAxis_data = ["一般", "二班"]
  364. var curlegend = ["标准差"];
  365. var curseries = [{
  366. name: "标准差",
  367. type: "bar",
  368. barWidth: $.UnitUtil.mm2px(5),
  369. // 柱状图最小高度
  370. barMinHeight: $.UnitUtil.mm2px(2),
  371. barGap: 0,
  372. data: [60, 70],
  373. itemStyle: itemStyle
  374. }];
  375. var option = {
  376. animation: false,
  377. color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
  378. title: {
  379. text: "分",
  380. x: "left",
  381. y: "top",
  382. textStyle: {
  383. color: "#5F6E82",
  384. fontSize: $.UnitUtil.mm2px(3),
  385. fontWeight: 500
  386. }
  387. },
  388. legend: {
  389. itemWidth: $.UnitUtil.mm2px(2),
  390. itemHeight: $.UnitUtil.mm2px(2),
  391. top: "bottom",
  392. data: curlegend
  393. },
  394. grid: {
  395. top: $.UnitUtil.mm2px(10),
  396. left: 0,
  397. right: 0,
  398. bottom: $.UnitUtil.mm2px(8),
  399. containLabel: true,
  400. },
  401. xAxis: [{
  402. type: "category",
  403. data: xAxis_data,
  404. axisLabel: {
  405. color: "#5F6E82" //更改坐标轴文字颜色
  406. },
  407. axisTick: {
  408. alignWithLabel: true
  409. },
  410. boundaryGap: true,
  411. triggerEvent: true,
  412. axisLine: {
  413. show: true, //是否显示轴线
  414. lineStyle: {
  415. color: "#DADADA" //刻度线的颜色
  416. }
  417. }
  418. }],
  419. yAxis: [{
  420. type: "value",
  421. axisTick: {
  422. show: false //刻度
  423. },
  424. axisLine: {
  425. show: false, //是否显示轴线
  426. lineStyle: {
  427. color: "#DADADA" //刻度线的颜色
  428. }
  429. },
  430. splitLine: {
  431. //网格线
  432. lineStyle: {
  433. type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
  434. },
  435. show: true //隐藏或显示
  436. },
  437. axisLabel: {
  438. color: "#5F6E82" //更改坐标轴文字颜色
  439. }
  440. }],
  441. series: curseries
  442. };
  443. var myEcharts = echarts.init(document.querySelector(".section1 #bzcEcharts"));
  444. myEcharts.clear();
  445. myEcharts.setOption(option);
  446. }
  447. var parameter = $(".section_1_html_root").data("page-params");
  448. console.log("section_1:parameter", parameter);
  449. initAverageScoreEcharts();
  450. initExcellenceRateEcharts();
  451. initExamnumEcharts();
  452. initbzcEcharts();
  453. });