信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
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.

index.js 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import ChartScatter1 from '../../../src/chart/scatter/ChartScatter1/ChartScatter1';
  2. import Tooltip from '../../../src/chart/commonOptions/tooltip';
  3. let chart=new ChartScatter1(document.getElementsByClassName('c1')[0],{});
  4. window.addEventListener("resize",()=>{
  5. chart.resize();
  6. });
  7. // setTimeout(()=>{
  8. // chart.setOption(opt);
  9. // },3000)
  10. let opt = {
  11. title: {
  12. text: '',
  13. left: '10%',
  14. top: '4%',
  15. textStyle: {
  16. fontSize: 14,
  17. color: '#2f92d9'
  18. }
  19. },
  20. legend: {
  21. show: true,
  22. left: "18%",
  23. top: '6%',
  24. orient: 'horizontal',
  25. itemWidth: 12,
  26. },
  27. bg: {
  28. backgroundColor: '#000000'
  29. },
  30. tooltip: Tooltip.option,
  31. grid: {
  32. left: '17%',
  33. right: '17%',
  34. top: '16%',
  35. bottom: '12%'
  36. },
  37. shape: {
  38. bg: {
  39. show: true,
  40. color: 'rgba(0,0,0,0)'
  41. },
  42. maxR: 10,
  43. minR: 1,
  44. animate: {
  45. delayTime: 10000,
  46. duringTime: 5000
  47. }
  48. },
  49. xAxis: {
  50. type: 'value',
  51. scale: true,
  52. axisTick: {
  53. show: false,
  54. alignWithLabel: false,
  55. // interval: 'auto',
  56. lineStyle: {
  57. color: '#26426a'
  58. }
  59. },
  60. axisLine: {
  61. show: true,
  62. lineStyle: {
  63. color: '#242424',
  64. width: 2,
  65. type: 'solid'
  66. }
  67. },
  68. axisLabel: {
  69. show: true,
  70. textBgColor: '#1f1f1f',
  71. textStyle: {
  72. fontSize: 12,
  73. fontWeight: 'normal',
  74. color: '#bdbdbd'
  75. }
  76. // margin: 0,
  77. },
  78. splitLine: {
  79. show: false,
  80. lineStyle: {
  81. color: '#26426a',
  82. width: 1,
  83. type: 'solid'
  84. }
  85. }
  86. },
  87. yAxis: {
  88. type: 'value',
  89. title: '',
  90. nameTextStyle: {
  91. color: '#bdbdbd',
  92. fontSize: 14
  93. },
  94. scale: true,
  95. axisLine: {
  96. show: true,
  97. lineStyle: {
  98. color: '#333333',
  99. width: 1,
  100. type: 'solid'
  101. }
  102. },
  103. splitLine: {
  104. show: true,
  105. lineStyle: {
  106. color: '#141414',
  107. width: 1,
  108. type: 'solid'
  109. }
  110. },
  111. axisTick: {
  112. show: false,
  113. alignWithLabel: true,
  114. interval: 'auto',
  115. lineStyle: {
  116. color: '#333333',
  117. }
  118. },
  119. axisLabel: {
  120. textStyle: {
  121. color: '#bdbdbd'
  122. }
  123. },
  124. },
  125. color:['#3fffa7', '#3b87f0', '#f48142', '#e3c153'],
  126. series: [
  127. // {
  128. // name: '类别1',
  129. // type: 'scatter',
  130. // data: [[174, 65.6, 0.4], [175.3, 71.8, 0.59], [193.5, 80.7, 0.82], [186.5, 72.6, 0.51], [187.2, 78.8, 0.77], [181.5, 74.8, 0.18], [184, 86.4, 0.3], [184.5, 78.4, 0.54], [175, 62, 0.71], [184, 81.6, 0.27], [180, 76.6, 0.76], [177.8, 83.6, 0.12], [192, 90, 0.03], [176, 74.6, 0.16], [174, 71, 0.58], [184, 79.6, 0.9], [192.7, 93.8, 0.09], [171.5, 70, 0.01], [173, 72.4, 0.07]],
  131. // },
  132. {
  133. name: '类别2',
  134. type: 'scatter',
  135. data: [[160, 47, 0.75], [154.4, 46.2, 0.36], [162, 55, 0.98], [176.5, 83, 0.26], [152, 45.8, 0.92], [170, 73.2, 0.55], [156.5, 67.2, 0.02], [164, 53.8, 0.54], [162.8, 58, 0.13], [167, 59.8, 0.8], [160, 54.8, 0.44], [160, 43.2, 0.45], [168.9, 60.5, 0.52], [158.2, 46.4, 0.41], [156, 64.4, 0.67]],
  136. },
  137. ]
  138. };