Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

section_3.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. $(function () {
  2. function initSubjectBadEcharts() {
  3. var xAxis_data = [
  4. "语文",
  5. "数学",
  6. "英语",
  7. "物理",
  8. "地理",
  9. "化学",
  10. "道德与法治",
  11. "历史",
  12. "生物"
  13. ];
  14. var series_data = [12, 20, 15, 8, 7, 11, 13, 15, 8];
  15. var option = {
  16. animation: false,
  17. title: {
  18. text: "人",
  19. x: "left",
  20. y: "top",
  21. textStyle: {
  22. color: "#5F6E82",
  23. fontSize: $.UnitUtil.mm2px(3),
  24. fontWeight: 500,
  25. },
  26. },
  27. color: ["#5C99FF"],
  28. legend: {
  29. itemWidth: $.UnitUtil.mm2px(2),
  30. itemHeight: $.UnitUtil.mm2px(2),
  31. top: "bottom",
  32. data: ["违纪人数"],
  33. },
  34. grid: {
  35. top: $.UnitUtil.mm2px(10),
  36. left: 0,
  37. right: 0,
  38. bottom: $.UnitUtil.mm2px(8),
  39. containLabel: true,
  40. },
  41. xAxis: [
  42. {
  43. type: "category",
  44. data: xAxis_data,
  45. axisLabel: {
  46. color: "#5F6E82", //更改坐标轴文字颜色
  47. interval: 0
  48. },
  49. axisTick: {
  50. alignWithLabel: true,
  51. },
  52. boundaryGap: true,
  53. triggerEvent: true,
  54. axisLine: {
  55. show: true, //是否显示轴线
  56. lineStyle: {
  57. color: "#DADADA", //刻度线的颜色
  58. },
  59. },
  60. },
  61. ],
  62. yAxis: [
  63. {
  64. type: "value",
  65. axisTick: {
  66. show: false, //刻度
  67. },
  68. axisLine: {
  69. show: false, //是否显示轴线
  70. lineStyle: {
  71. color: "#DADADA", //刻度线的颜色
  72. },
  73. },
  74. splitLine: {
  75. //网格线
  76. lineStyle: {
  77. type: "dotted", //设置网格线类型 dotted:虚线 solid:实线
  78. },
  79. show: true, //隐藏或显示
  80. },
  81. axisLabel: {
  82. color: "#5F6E82", //更改坐标轴文字颜色
  83. },
  84. },
  85. ],
  86. series: [
  87. {
  88. name: "违纪人数",
  89. type: "bar",
  90. barWidth: $.UnitUtil.mm2px(5),
  91. // 柱状图最小高度
  92. barMinHeight: $.UnitUtil.mm2px(2),
  93. barGap: 0,
  94. label: {
  95. normal: {
  96. show: true,
  97. align: "center",
  98. verticalAlign: "bottom",
  99. position: "top",
  100. distance: 0,
  101. formatter: "{c}",
  102. },
  103. },
  104. data: series_data,
  105. },
  106. ],
  107. };
  108. var myEcharts = echarts.init(document.querySelector(".section_3 #subjectBadEcharts"));
  109. myEcharts.clear();
  110. myEcharts.setOption(option);
  111. }
  112. var parameter = $(".section_3_html_root").data("page-params");
  113. console.log("section_3:parameter", parameter);
  114. initSubjectBadEcharts();
  115. });