信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致

index.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. import ChartLine from '../../../src/chart/line/ChartLine11/ChartLine11.js';
  2. import Title from "../../../src/chart/commonOptions/title";
  3. import Grid from "../../../src/chart/commonOptions/grid";
  4. import ToolTip from "../../../src/chart/commonOptions/tooltip";
  5. let chart = new ChartLine(document.getElementsByClassName('c1')[0], {});
  6. window.addEventListener('resize', () => {
  7. chart.resize();
  8. });
  9. // let option = {
  10. // color: ['#c6b146','#ffffff','#94ddf3', '#18c1f1', '#ed9c01', '#d0e3ff', '#00bfff', '#008b8b', '#00fa9a', '#0000ff'],
  11. // title: Title.option(''),
  12. // bg: {
  13. // backgroundColor: '#101029'
  14. // },
  15. // grid: Grid.option,
  16. // tooltip: {
  17. // // dangerline: {
  18. // // show: true,
  19. // // dangerData: 8
  20. // // },
  21. // // targetline: {
  22. // // show: true,
  23. // // targetData: 12
  24. // // },
  25. // // guideline: {
  26. // // show: true,
  27. // // color: '#ccc'
  28. // // }
  29. // backgroundColor: '#ffffff',
  30. // opacity: 0.05
  31. // },
  32. // legend: {
  33. // itemHeight: 10,
  34. // itemWidth: 10,
  35. // itemAngelR: 20,
  36. // left:'22%',
  37. // top:'8%'
  38. // },
  39. // xAxis: {
  40. // type: "category",
  41. // // title: '日期',
  42. // nameTextStyle: {
  43. // fontSize: 12,
  44. // color: '#797979',
  45. // },
  46. // namePosition: 'end',
  47. // // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  48. // data: ['2012','2013','2014','2015','2016','2017','2018','2019'],
  49. // boundaryGap: false,
  50. // // scale: true,
  51. // axisLine: {
  52. // show: true,
  53. // lineStyle: {
  54. // color: '#ffffff',
  55. // opacity: 0.3,
  56. // width: 4,
  57. // type: 'solid'
  58. // }
  59. // },
  60. // axisTick: {
  61. // show: false,
  62. // alignWithLabel: false,
  63. // // interval: 'auto'
  64. // },
  65. // splitLine: {
  66. // show: true,
  67. // lineStyle: {
  68. // color: '#ffffff',
  69. // opacity:0.05,
  70. // width: 1,
  71. // type: 'solid'
  72. // }
  73. // },
  74. // axisLabel: {
  75. // show: true,
  76. // textStyle: {
  77. // color: '#797979',
  78. // textRotation:30
  79. // }
  80. // }
  81. // },
  82. // yAxis: {
  83. // type: 'value',
  84. // title: '单位',
  85. // nameTextStyle: {
  86. // fontSize: 12,
  87. // color: '#797979',
  88. // },
  89. // namePosition: 'end',
  90. // scale: true,
  91. // axisLine: {
  92. // show: true,
  93. // lineStyle: {
  94. // color: '#ffffff',
  95. // opacity: 0.3,
  96. // width: 4,
  97. // type: 'solid'
  98. // }
  99. // },
  100. // axisTick: {
  101. // show: false,
  102. // alignWithLabel: true,
  103. // interval: 'auto',
  104. // lineStyle: {
  105. // color: '#ffffff',
  106. // opacity: 0.3,
  107. // width: 1
  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. // format:true,
  122. // textStyle: {
  123. // color: '#797979'
  124. // }
  125. // }
  126. // },
  127. // shape:{
  128. // label: {
  129. // show: false,
  130. // textStyle: {
  131. // fontSize: 12,
  132. // fontWeight: 'normal',
  133. // color: ''
  134. // }
  135. // },
  136. // lineStyle: {
  137. // width: 2,
  138. // smooth: false,
  139. // },
  140. // lineShadow: {
  141. // shadowColor: '#000000',
  142. // shadowOffsetX: 0,
  143. // shadowOffsetY: 0,
  144. // shadowBlur: 0
  145. // },
  146. // iconType: 'circle',
  147. // circleSize: 2,
  148. // circleFill: '#ffffff',
  149. // },
  150. // series: [
  151. // {
  152. // name: '类别一',
  153. // type: 'bar',
  154. // data: [4.1, 3.9, 3.7, 3.95, 3.3, 3.5, 2.9, 2.2],
  155. // }, {
  156. // name: '类别二',
  157. // type: 'bar',
  158. // data: [3, 3.5, 2.9, 3.1, 3, 3.2, 2.5, 3.3],
  159. // }
  160. // // {
  161. // // name: '目标值',
  162. // // type: 'bar',
  163. // // data: [810000, 1200000, 1600000, 2100000, 2560000, 3000000, 3400000, 3900000, 4330000, 4760000, 5340000, 5900000],
  164. // // }, {
  165. // // name: '实际值',
  166. // // type: 'bar',
  167. // // data: [610000, 1000000, 1800000, 2200000, 2400000, 2600000, 3050000, 3590000, 4220000, 4860000, 5640000, 6800000],
  168. // // }, {
  169. // // name: '同期值',
  170. // // type: 'bar',
  171. // // data: [510000, 800000, 1200000, 1700000, 2200000, 2500000, 2800000, 3390000, 3850000, 4660000, 5040000, 5300000],
  172. // // }
  173. // ]
  174. // };
  175. // let option2 = {
  176. // color: ['#c6b146','#ffffff','#94ddf3', '#18c1f1', '#ed9c01', '#d0e3ff', '#00bfff', '#008b8b', '#00fa9a', '#0000ff'],
  177. // title: Title.option(''),
  178. // bg: {
  179. // backgroundColor: '#101029'
  180. // },
  181. // grid: Grid.option,
  182. // tooltip: {
  183. // // dangerline: {
  184. // // show: true,
  185. // // dangerData: 8
  186. // // },
  187. // // targetline: {
  188. // // show: true,
  189. // // targetData: 12
  190. // // },
  191. // // guideline: {
  192. // // show: true,
  193. // // color: '#ccc'
  194. // // }
  195. // backgroundColor: '#ffffff',
  196. // opacity: 0.05
  197. // },
  198. // legend: {
  199. // itemHeight: 10,
  200. // itemWidth: 10,
  201. // itemAngelR: 20,
  202. // left:'22%',
  203. // top:'8%'
  204. // },
  205. // xAxis: {
  206. // type: "category",
  207. // // title: '日期',
  208. // nameTextStyle: {
  209. // fontSize: 12,
  210. // color: '#797979',
  211. // },
  212. // namePosition: 'end',
  213. // // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  214. // data: ['2012','2013','2014','2015','2016','2017','2018','2019'],
  215. // boundaryGap: false,
  216. // // scale: true,
  217. // axisLine: {
  218. // show: true,
  219. // lineStyle: {
  220. // color: '#ffffff',
  221. // opacity: 0.3,
  222. // width: 4,
  223. // type: 'solid'
  224. // }
  225. // },
  226. // axisTick: {
  227. // show: false,
  228. // alignWithLabel: false,
  229. // // interval: 'auto'
  230. // },
  231. // splitLine: {
  232. // show: true,
  233. // lineStyle: {
  234. // color: '#ffffff',
  235. // opacity:0.05,
  236. // width: 1,
  237. // type: 'solid'
  238. // }
  239. // },
  240. // axisLabel: {
  241. // show: true,
  242. // textStyle: {
  243. // color: '#797979',
  244. // textRotation:30
  245. // }
  246. // }
  247. // },
  248. // yAxis: {
  249. // type: 'value',
  250. // title: '单位',
  251. // nameTextStyle: {
  252. // fontSize: 12,
  253. // color: '#797979',
  254. // },
  255. // namePosition: 'end',
  256. // scale: true,
  257. // axisLine: {
  258. // show: true,
  259. // lineStyle: {
  260. // color: '#ffffff',
  261. // opacity: 0.3,
  262. // width: 4,
  263. // type: 'solid'
  264. // }
  265. // },
  266. // axisTick: {
  267. // show: false,
  268. // alignWithLabel: true,
  269. // interval: 'auto',
  270. // lineStyle: {
  271. // color: '#ffffff',
  272. // opacity: 0.3,
  273. // width: 1
  274. // }
  275. // },
  276. // splitLine: {
  277. // show: true,
  278. // lineStyle: {
  279. // color: '#ffffff',
  280. // opacity: 0.05,
  281. // width: 1,
  282. // type: 'solid'
  283. // }
  284. // },
  285. // axisLabel: {
  286. // show: true,
  287. // format:true,
  288. // textStyle: {
  289. // color: '#797979'
  290. // }
  291. // }
  292. // },
  293. // shape:{
  294. // label: {
  295. // show: false,
  296. // textStyle: {
  297. // fontSize: 12,
  298. // fontWeight: 'normal',
  299. // color: ''
  300. // }
  301. // },
  302. // lineStyle: {
  303. // width: 2,
  304. // smooth: false,
  305. // },
  306. // lineShadow: {
  307. // shadowColor: '#000000',
  308. // shadowOffsetX: 0,
  309. // shadowOffsetY: 0,
  310. // shadowBlur: 0
  311. // },
  312. // iconType: 'trigon',
  313. // circleSize: 10,
  314. // circleFill: '#ffffff',
  315. // },
  316. // series: [
  317. // {
  318. // name: '类别一',
  319. // type: 'bar',
  320. // data: [4.1, 3.9, 3.7, 3.95, 3.3, 3.5, 2.9, 2.2],
  321. // }, {
  322. // name: '类别二',
  323. // type: 'bar',
  324. // data: [3, 3.5, 2.9, 3.1, 3, 3.2, 2.5, 3.3],
  325. // }
  326. // // {
  327. // // name: '目标值',
  328. // // type: 'bar',
  329. // // data: [810000, 1200000, 1600000, 2100000, 2560000, 3000000, 3400000, 3900000, 4330000, 4760000, 5340000, 5900000],
  330. // // }, {
  331. // // name: '实际值',
  332. // // type: 'bar',
  333. // // data: [610000, 1000000, 1800000, 2200000, 2400000, 2600000, 3050000, 3590000, 4220000, 4860000, 5640000, 6800000],
  334. // // }, {
  335. // // name: '同期值',
  336. // // type: 'bar',
  337. // // data: [510000, 800000, 1200000, 1700000, 2200000, 2500000, 2800000, 3390000, 3850000, 4660000, 5040000, 5300000],
  338. // // }
  339. // ]
  340. // };
  341. // setTimeout(()=>{
  342. // chart.setOption(option)
  343. // },2000)
  344. // setTimeout(()=>{
  345. // chart.setOption(option2)
  346. // },4000)