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

index.js 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. // import Chart1 from "../../../src/chart/center/ChartCenterLine1/ChartCenterLine1";
  2. import Chart2 from "../../../src/chart/center/ChartCenterLine1/ChartCenterLine1";
  3. import Title from "../../../src/chart/commonOptions/title";
  4. // let bar1 = new Chart1(document.querySelector(".c1"), {});
  5. let bar2 = new Chart2(document.querySelector(".c2"), {});
  6. // bar2.setZoomCallBack(bar1.setZoomSlider);
  7. window.addEventListener("resize", function () {
  8. // bar1.resize();
  9. bar2.resize()
  10. });
  11. window.addEventListener("elementClick",(data)=>{
  12. console.log(data)
  13. })
  14. setTimeout(()=>{
  15. bar2.setOption( {
  16. color: ['#00deff','#3f90ff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
  17. title: Title.option(''),
  18. bg: {
  19. backgroundColor: '#062541',
  20. },
  21. grid1:{
  22. left:"18%",
  23. right:"18%",
  24. top:"10%",
  25. bottom:"62%"
  26. },
  27. grid2:{
  28. left:"18%",
  29. right:"18%",
  30. top:"54%",
  31. bottom:"26%"
  32. },
  33. legend1:{
  34. itemHeight: 10,
  35. itemWidth: 10,
  36. itemAngelR: 20,
  37. left:'18%',
  38. top:'4%',
  39. textStyle:{
  40. color: '#8ca6ad'
  41. }
  42. },
  43. legend2: {
  44. itemHeight: 10,
  45. itemWidth: 10,
  46. itemAngelR: 20,
  47. left:'18%',
  48. top:'48%',
  49. textStyle:{
  50. color: '#8ca6ad'
  51. }
  52. },
  53. dataZoom:{
  54. show:true,
  55. position:"85%",
  56. zoomHeight:33,
  57. zoomMaskColor:"rgba(14,74,227,0.1)",
  58. zoomBackgroundColor:"rgba(0,0,0,0)",
  59. zoomAreaColor:"rgba(4,66,99,0.8)",
  60. zoomLineColor:"rgba(4,66,99,0.8)",
  61. zoomHandleColor:"#00deff"
  62. },
  63. tooltip: {
  64. // titleColor:'#fff',
  65. bgStyle:{
  66. backgroundColor:'rgba(0,0,0,0.7)',
  67. // borderColor:'#888e0e',
  68. // borderWidth:1
  69. },
  70. },
  71. xAxis1: {
  72. type: "category",
  73. // title: '日期',
  74. nameTextStyle: {
  75. fontSize: 12,
  76. color: '#797979',
  77. },
  78. namePosition: 'end',
  79. // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  80. data: ['2011','2012','2013','2014','2015','2016','2017','2018','2019'],
  81. // boundaryGap: true,
  82. // scale: true,
  83. axisLine: {
  84. show: true,
  85. lineStyle: {
  86. color: '#275176',
  87. // opacity: 0.3,
  88. width: 4,
  89. // type: 'solid'
  90. }
  91. },
  92. axisTick: {
  93. show: false,
  94. alignWithLabel: false,
  95. // interval: 'auto'
  96. },
  97. splitLine: {
  98. show: true,
  99. lineStyle: {
  100. color: 'rgba(255,255,255,0.3)',
  101. // opacity: 0.3,
  102. width: 1,
  103. type: 'solid'
  104. }
  105. },
  106. axisLabel: {
  107. show: true,
  108. margin:5,
  109. textStyle: {
  110. color: '#797979',
  111. textRotation: 0
  112. }
  113. }
  114. },
  115. yAxis1: {
  116. type: 'value',
  117. title: '',
  118. splitNumber:2,
  119. nameTextStyle: {
  120. fontSize: 12,
  121. color: '#797979',
  122. },
  123. namePosition: 'end',
  124. scale: true,
  125. axisLine: {
  126. show: true,
  127. lineStyle: {
  128. color: '#275176',
  129. opacity: 0.3,
  130. width: 4,
  131. type: 'solid'
  132. }
  133. },
  134. axisTick: {
  135. show: false,
  136. alignWithLabel: true,
  137. interval: 'auto',
  138. lineStyle: {
  139. color: '#ffffff',
  140. opacity: 0.3,
  141. width: 1
  142. }
  143. },
  144. splitLine: {
  145. show: true,
  146. lineStyle: {
  147. color: '#ffffff',
  148. opacity: 0.3,
  149. width: 1,
  150. type: 'solid'
  151. }
  152. },
  153. axisLabel: {
  154. show: true,
  155. format:true,
  156. textStyle: {
  157. color: '#797979'
  158. }
  159. }
  160. },
  161. xAxis2: {
  162. type: "category",
  163. // title: '日期',
  164. nameTextStyle: {
  165. fontSize: 12,
  166. color: '#ccc',
  167. },
  168. namePosition: 'end',
  169. // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  170. data: ['2011','2012','2013','2014','2015','2016','2017','2018','2019'],
  171. boundaryGap: true,
  172. // scale: true,
  173. axisLine: {
  174. show: false,
  175. lineStyle: {
  176. color: 'rgba(255,255,255,0.2)',
  177. width: 2,
  178. type: 'solid'
  179. }
  180. },
  181. axisTick: {
  182. show: false,
  183. alignWithLabel: true,
  184. length: -2,
  185. lineStyle:{
  186. width:2,
  187. color:'rgba(255,255,255,0.1)',
  188. // opacity: 0.1,
  189. }
  190. },
  191. splitLine: {
  192. show: false,
  193. lineStyle: {
  194. color: 'rgba(255,255,255,0.2)',
  195. width: 1,
  196. type: 'solid'
  197. }
  198. },
  199. axisLabel: {
  200. show: true,
  201. textStyle: {
  202. color: '#797979',
  203. backgroundColor: 'rgba(255,255,255,0.05)',
  204. highlightColor: '#ffffff',
  205. textRotation:0,
  206. }
  207. }
  208. },
  209. yAxis2: {
  210. type: 'value',
  211. title: '',
  212. splitNumber:2,
  213. nameTextStyle: {
  214. fontSize: 12,
  215. color: '#606060',
  216. },
  217. namePosition: 'end',
  218. scale: true,
  219. axisLine: {
  220. show: true,
  221. lineStyle: {
  222. color: 'rgba(255,255,255,0.2)',
  223. width: 1,
  224. type: 'solid',
  225. distance: 2, //偏移距离
  226. }
  227. },
  228. axisTick: {
  229. show: true,
  230. alignWithLabel: false,
  231. length:-5,
  232. lineStyle:{
  233. width:2,
  234. color:'rgba(255,255,255,0.1)',
  235. // opacity: 0.1,
  236. }
  237. },
  238. splitLine: {
  239. show: false,
  240. lineStyle: {
  241. color: 'rgba(255,255,255,0.2)',
  242. // opacity: 0.2,
  243. width: 1,
  244. type: 'solid'
  245. }
  246. },
  247. axisLabel: {
  248. show: true,
  249. textStyle: {
  250. color: '#606060'
  251. }
  252. }
  253. },
  254. shape:{
  255. label: {
  256. show: false,
  257. textStyle: {
  258. fontSize: 12,
  259. fontWeight: 'normal',
  260. color: ''
  261. }
  262. },
  263. lineStyle: {
  264. width: 2,
  265. smooth: 'spline',
  266. },
  267. lineShadow: {
  268. // shadowColor: '#000000',
  269. shadowOffsetX: 0,
  270. shadowOffsetY: 0,
  271. shadowBlur: 5
  272. },
  273. circleSize: 5,
  274. bgGrid:{
  275. color: 'rgba(255,255,255,0.05)',
  276. }
  277. },
  278. series: [
  279. {
  280. name: '类别一',
  281. type: 'main',
  282. data: [0.45, 0.51, 0.67, 0.64, 0.55, 0.31, 0.57, 0.87, 0.89],
  283. },
  284. {
  285. name: '类别二',
  286. type: 'bar',
  287. data: [0.35,0.2, 0.25, 0.34, 0.3, 0.15, 0.16, 0.21, 0.27],
  288. },
  289. {
  290. name: '类别三',
  291. type: 'bar',
  292. data: [0.1, 0.31, 0.42, 0.3, 0.25, 0.16, 0.41, 0.66, 0.62],
  293. }
  294. ]
  295. })
  296. },2400)