信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. import ChartLine from '../../../src/chart/line/ChartLine13/ChartLine13.js';
  2. import Grid from '../../../src/chart/commonOptions/grid'
  3. let chart = new ChartLine(document.getElementsByClassName('c1')[0], {});
  4. window.addEventListener('resize', () => {
  5. chart.resize();
  6. });
  7. let option = {
  8. color: ['#9df04d','#ffffff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
  9. title: {},
  10. bg: {
  11. backgroundColor: '#000000'
  12. },
  13. grid: Grid.option,
  14. tooltip: {
  15. titleColor:'#fff',
  16. bgStyle:{
  17. backgroundColor:'rgba(255,255,255,0.05)',
  18. // borderColor:'#888e0e',
  19. // borderWidth:1
  20. },
  21. nameColor:'#ffda2a',
  22. valueColor:'#ffda2a'
  23. },
  24. legend: {
  25. itemHeight: 10,
  26. itemWidth: 10,
  27. itemAngelR: 20,
  28. left:'22%',
  29. top:'8%'
  30. },
  31. xAxis: {
  32. type: "category",
  33. // title: '日期',
  34. nameTextStyle: {
  35. fontSize: 12,
  36. color: '#ccc',
  37. },
  38. namePosition: 'end',
  39. // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  40. data: ['2011','2012','2013','2014','2015','2016','2017','2018','2019'],
  41. boundaryGap: true,
  42. // scale: true,
  43. axisLine: {
  44. show: true,
  45. lineStyle: {
  46. color: '#ffff00',
  47. opacity: 0.3,
  48. width: 2,
  49. type: 'solid'
  50. }
  51. },
  52. axisTick: {
  53. show: true,
  54. alignWithLabel: true,
  55. length:30,
  56. topTickDis: 30,
  57. lineStyle:{
  58. width:2,
  59. color:'#ffff00',
  60. opacity: 0.1,
  61. }
  62. },
  63. splitLine: {
  64. show: true,
  65. lineStyle: {
  66. color: '#ffffff',
  67. opacity: 0.05,
  68. width: 1,
  69. type: 'solid'
  70. }
  71. },
  72. axisLabel: {
  73. show: false,
  74. textStyle: {
  75. color: '#797979',
  76. backgroundColor: 'rgba(255,255,255,0.1)',
  77. highlightColor: '#ffffff',
  78. textRotation:0
  79. }
  80. }
  81. },
  82. yAxis: {
  83. type: 'value',
  84. title: '单位',
  85. nameTextStyle: {
  86. fontSize: 12,
  87. color: '#606060',
  88. },
  89. namePosition: 'end',
  90. scale: true,
  91. axisLine: {
  92. show: true,
  93. lineStyle: {
  94. color: '#ffffff',
  95. opacity: 0.3,
  96. width: 2,
  97. type: 'solid',
  98. distance: 10, //偏移距离
  99. }
  100. },
  101. axisTick: {
  102. show: true,
  103. alignWithLabel: false,
  104. length:5,
  105. lineStyle:{
  106. width:2,
  107. color:'#fffe00'
  108. }
  109. },
  110. splitLine: {
  111. show: true,
  112. lineStyle: {
  113. color: '#ffffff',
  114. opacity: 0.05,
  115. width: 1,
  116. type: 'solid'
  117. }
  118. },
  119. axisLabel: {
  120. show: true,
  121. textStyle: {
  122. color: '#606060'
  123. }
  124. }
  125. },
  126. shape:{
  127. label: {
  128. show: true,
  129. textStyle: {
  130. fontSize: 12,
  131. fontWeight: 'normal',
  132. color: ''
  133. }
  134. },
  135. lineStyle: {
  136. width: 4,
  137. smooth: 'spline',
  138. },
  139. lineShadow: {
  140. shadowColor: '#000000',
  141. shadowOffsetX: 0,
  142. shadowOffsetY: 0,
  143. shadowBlur: 0
  144. },
  145. circleSize: 5,
  146. },
  147. series: [
  148. // {
  149. // name: '类别一',
  150. // type: 'bar',
  151. // data: [164, 166, 168, 17.3, 18, 18.3, 18.5, 18.8, 19.2],
  152. // }, {
  153. // name: '类别二',
  154. // type: 'bar',
  155. // data: [17.3, 17.5, 17.6, 17.6, 17.7, 17.8, 18, 18.1, 18.5],
  156. // }
  157. {
  158. name: '类别一',
  159. type: 'bar',
  160. data: [810000, 1200000, 1600000, 2100000, 2560000, 3000000, 3400000, 3900000, 4330000],
  161. }, {
  162. name: '类别二',
  163. type: 'bar',
  164. data: [610000, 1000000, 1800000, 2200000, 2400000, 2600000, 3050000, 3590000, 4220000],
  165. },
  166. ]
  167. };
  168. let option1 = {
  169. color: ['#9df04d','#ffffff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
  170. title: {},
  171. bg: {
  172. backgroundColor: '#000000'
  173. },
  174. grid: Grid.option,
  175. tooltip: {
  176. titleColor:'#fff',
  177. bgStyle:{
  178. backgroundColor:'rgba(255,255,255,0.05)',
  179. // borderColor:'#888e0e',
  180. // borderWidth:1
  181. },
  182. nameColor:'#ffda2a',
  183. valueColor:'#ffda2a'
  184. },
  185. legend: {
  186. itemHeight: 10,
  187. itemWidth: 10,
  188. itemAngelR: 20,
  189. left:'22%',
  190. top:'8%'
  191. },
  192. xAxis: {
  193. type: "category",
  194. // title: '日期',
  195. nameTextStyle: {
  196. fontSize: 12,
  197. color: '#ccc',
  198. },
  199. namePosition: 'end',
  200. // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  201. data: ['2011','2012','2013','2014','2015','2016','2017','2018','2019'],
  202. boundaryGap: true,
  203. // scale: true,
  204. axisLine: {
  205. show: true,
  206. lineStyle: {
  207. color: '#ffff00',
  208. opacity: 0.3,
  209. width: 2,
  210. type: 'solid'
  211. }
  212. },
  213. axisTick: {
  214. show: true,
  215. alignWithLabel: true,
  216. length:30,
  217. topTickDis: 30,
  218. lineStyle:{
  219. width:2,
  220. color:'#ffff00',
  221. opacity: 0.1,
  222. }
  223. },
  224. splitLine: {
  225. show: true,
  226. lineStyle: {
  227. color: '#ffffff',
  228. opacity: 0.05,
  229. width: 1,
  230. type: 'solid'
  231. }
  232. },
  233. axisLabel: {
  234. show: true,
  235. textStyle: {
  236. color: '#797979',
  237. backgroundColor: 'rgba(255,255,255,0.1)',
  238. highlightColor: '#ffffff',
  239. textRotation:0
  240. }
  241. }
  242. },
  243. yAxis: {
  244. type: 'value',
  245. title: '单位',
  246. nameTextStyle: {
  247. fontSize: 12,
  248. color: '#606060',
  249. },
  250. namePosition: 'end',
  251. scale: true,
  252. axisLine: {
  253. show: true,
  254. lineStyle: {
  255. color: '#ffffff',
  256. opacity: 0.3,
  257. width: 2,
  258. type: 'solid',
  259. distance: 10, //偏移距离
  260. }
  261. },
  262. axisTick: {
  263. show: true,
  264. alignWithLabel: false,
  265. length:10,
  266. lineStyle:{
  267. width:2,
  268. color:'#fffe00'
  269. }
  270. },
  271. splitLine: {
  272. show: true,
  273. lineStyle: {
  274. color: '#ffffff',
  275. opacity: 0.05,
  276. width: 1,
  277. type: 'solid'
  278. }
  279. },
  280. axisLabel: {
  281. show: true,
  282. textStyle: {
  283. color: '#606060'
  284. }
  285. }
  286. },
  287. shape:{
  288. label: {
  289. show: true,
  290. textStyle: {
  291. fontSize: 12,
  292. fontWeight: 'normal',
  293. color: ''
  294. }
  295. },
  296. lineStyle: {
  297. width: 4,
  298. smooth: 'spline',
  299. },
  300. lineShadow: {
  301. shadowColor: '#000000',
  302. shadowOffsetX: 0,
  303. shadowOffsetY: 0,
  304. shadowBlur: 0
  305. },
  306. circleSize: 5,
  307. },
  308. series: [
  309. // {
  310. // name: '类别一',
  311. // type: 'bar',
  312. // data: [164, 166, 168, 17.3, 18, 18.3, 18.5, 18.8, 19.2],
  313. // }, {
  314. // name: '类别二',
  315. // type: 'bar',
  316. // data: [17.3, 17.5, 17.6, 17.6, 17.7, 17.8, 18, 18.1, 18.5],
  317. // }
  318. {
  319. name: '类别一',
  320. type: 'bar',
  321. data: [810000, 1200000, 1600000, 2100000, 2560000, 3000000, 3400000, 3900000, 4330000],
  322. }, {
  323. name: '类别二',
  324. type: 'bar',
  325. data: [610000, 1000000, 1800000, 2200000, 2400000, 2600000, 3050000, 3590000, 4220000],
  326. },
  327. ]
  328. };
  329. // setTimeout(()=>{
  330. // chart.setOption(option)
  331. // },2000)
  332. // setTimeout(()=>{
  333. // chart.setOption(option1)
  334. // },4000)