oneQualified.jsx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * @Author: dayan_hjm 一次合格率
  3. * @Date: 2023-10-23 09:32:12
  4. * @Last Modified by: dayan_hjm
  5. * @Last Modified time: 2023-10-23 16:09:39
  6. */
  7. import React, { useState, useEffect, Component } from "react";
  8. import styles from "../style.less";
  9. import { useHistory, useLocation, withRouter } from "react-router-dom";
  10. import mod from '../mod';
  11. @withRouter
  12. class BottomLineForSend extends Component {
  13. // 构造函数,组件的实例创建时,最先执行
  14. constructor(props, context) {
  15. super(props, context);
  16. this.store = mod;
  17. this.state = {
  18. };
  19. }
  20. componentDidMount() {
  21. this.setData();
  22. }
  23. setData() {
  24. setTimeout(() => {
  25. // 基于准备好的dom,初始化echarts实例
  26. var myChart = echarts.init(document.getElementById('echarts5'));
  27. var option = {
  28. tooltip: {
  29. trigger: 'axis',
  30. axisPointer: { type: 'shadow' },
  31. borderColor:"rgba(105, 255, 222, 0.5)",
  32. borderWidth:2,
  33. padding:5,
  34. textStyle:{
  35. fontSize:12,
  36. color:"#ededed"
  37. },
  38. formatter: '{a0}: {c0}<br />{a1}: {c1}',
  39. backgroundColor:"#0000008a"
  40. }, "grid": {
  41. "top": "20%",
  42. "right": "15%",
  43. "bottom": "20",
  44. "left": "15%",
  45. },
  46. legend: {
  47. data: ['目标一次及格率', '实际一次及格率'],
  48. right: 'center',
  49. padding: [10, 0, 0, 15],
  50. top: 0,
  51. textStyle: {
  52. color: "#fff"
  53. },
  54. itemWidth: 12,
  55. itemHeight: 5,
  56. },
  57. "xAxis": [
  58. {
  59. "type": "category",
  60. data: ['2月', '3月', '4月', '5月', '6月'],
  61. axisLine: { lineStyle: { color: "rgba(255,255,255,.1)" } },
  62. axisLabel: {
  63. textStyle: { color: "rgba(255,255,255,.7)", fontSize: '12', },
  64. },
  65. splitLine:{
  66. show:true,
  67. lineStyle:{
  68. color: '#3b3b3b',
  69. type: 'dashed',
  70. }
  71. }
  72. },
  73. ],
  74. "yAxis": [
  75. {
  76. type: 'value',
  77. axisLine: {
  78. lineStyle: {
  79. color: '#7d7d7d',
  80. type: 'dashed',
  81. },
  82. },
  83. axisTick: { show: false },
  84. axisLabel: {
  85. formatter: "{value}",
  86. textStyle: {
  87. color: '#7d7d7d',
  88. fontSize: 12
  89. }
  90. },
  91. splitLine:{
  92. show:true,
  93. lineStyle:{
  94. color: '#3b3b3b',
  95. type: 'dashed',
  96. }
  97. }
  98. },
  99. ],
  100. "series": [
  101. {
  102. "name": "目标一次及格率",
  103. "type": "line",
  104. "data": [66, 16.8, 1.33, 12.65],
  105. lineStyle: {
  106. normal: {
  107. width: 2
  108. },
  109. },
  110. "itemStyle": {
  111. "normal": {
  112. "color": "#69FFDE",
  113. }
  114. },
  115. "smooth": true
  116. },
  117. {
  118. "name": "实际一次及格率",
  119. "type": "line",
  120. "data": [0, 11.48, 18.00, 25.65],
  121. lineStyle: {
  122. normal: {
  123. width: 2
  124. },
  125. },
  126. "itemStyle": {
  127. "normal": {
  128. "color": "#FFCE00",
  129. }
  130. },
  131. "smooth": true
  132. }
  133. ]
  134. };
  135. // 使用刚指定的配置项和数据显示图表。
  136. myChart.setOption(option);
  137. window.addEventListener("resize", function () {
  138. myChart.resize();
  139. });
  140. }, 3000)
  141. }
  142. render() {
  143. return (
  144. <div className={["eacharView cbBottomLineForSend"]}>
  145. <div id="echarts5"></div>
  146. </div>
  147. )
  148. }
  149. }
  150. export default BottomLineForSend;