Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

section_1.js 11KB

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