信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

index.js 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. import ChartBar from '../../../src/chart/bar/ChartBar4/ChartBar4.js';
  2. import Title from "../../../src/chart/commonOptions/title";
  3. import Grid from "../../../src/chart/commonOptions/grid";
  4. import Legend from "../../../src/chart/commonOptions/legend";
  5. import Tooltip from "../../../src/chart/commonOptions/tooltip";
  6. // import Title from "../../../src/chart/commonOptions/title";
  7. // import Grid from "../../../src/chart/commonOptions/grid";
  8. let bar = new ChartBar(document.getElementsByClassName('c1')[0], {});
  9. window.addEventListener('resize', () => {
  10. bar.resize();
  11. });
  12. setTimeout(() => {
  13. // bar.setOption(opt)
  14. }, 2000);
  15. setTimeout(() => {
  16. // bar.setOption(opt2)
  17. }, 4000);
  18. let opt = {
  19. color: ['#ff0000'],
  20. bg:{
  21. backgroundColor:'#000713'
  22. },
  23. title: Title.option('新经济普查工作'),
  24. grid:{
  25. left:'18%',
  26. top:'20%',
  27. right:'18%',
  28. bottom:'18%',
  29. containLabel: false
  30. },
  31. tooltip: Tooltip.option,
  32. legend: Legend.option,
  33. carousel: {
  34. show: false,
  35. showColumn: 3,
  36. r:20,
  37. color:'#ffff00',
  38. open: false
  39. },
  40. xAxis: {
  41. type: "category",
  42. data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七', '地区八'],
  43. axisLine: {
  44. show: true,
  45. lineStyle: {
  46. color: '#224c69',
  47. width: 2,
  48. }
  49. },
  50. axisTick: {
  51. show: true,
  52. alignWithLabel: true,
  53. interval: 'auto',
  54. length:3,
  55. lineStyle: {
  56. color: '#ffff00'
  57. }
  58. },
  59. axisLabel: {
  60. show: true,
  61. textStyle:{
  62. color:'#54b3ea'
  63. }
  64. // margin: 0,
  65. },
  66. splitLine: {
  67. show: false,
  68. lineStyle: {
  69. color: '#26426a',
  70. width: 1,
  71. }
  72. }
  73. },
  74. yAxis: {
  75. type: 'value',
  76. title:'(%)',
  77. nameTextStyle:{
  78. color:'#54b3ea'
  79. },
  80. axisLine: {
  81. show: true,
  82. lineStyle: {
  83. color: '#224c69',
  84. width: 2,
  85. type: 'solid'
  86. }
  87. },
  88. splitLine: {
  89. show: false,
  90. lineStyle: {
  91. color: '#26426a',
  92. width: 1,
  93. type: 'solid'
  94. }
  95. },
  96. axisTick: {
  97. show: true,
  98. interval: 'auto',
  99. length:3,
  100. lineStyle: {
  101. color: '#ffff00',
  102. }
  103. },
  104. axisLabel: {
  105. show: true,
  106. textStyle:{
  107. color:'#54b3ea'
  108. }
  109. // margin: 0,
  110. },
  111. },
  112. shape:{
  113. barCategoryGap: '30%',
  114. label: {
  115. show: false,
  116. textStyle: {
  117. fontSize: 12,
  118. fontWeight: 'normal',
  119. color: ''
  120. //'' 表示使用series默认颜色数组
  121. }
  122. }
  123. },
  124. series: [
  125. {
  126. name: '行业总产值',
  127. type: 'bar',
  128. data: [91,86,82,78,74,79,67,89]
  129. }
  130. ]
  131. };
  132. let opt2 = {
  133. color: ['#ffff00'],
  134. bg:{
  135. backgroundColor:'#000713'
  136. },
  137. title: Title.option('新经济普查工作'),
  138. grid:{
  139. left:'18%',
  140. top:'20%',
  141. right:'18%',
  142. bottom:'18%',
  143. containLabel: false
  144. },
  145. tooltip: Tooltip.option,
  146. legend: Legend.option,
  147. carousel: {
  148. show: true,
  149. showColumn: 2,
  150. r:20,
  151. color:'#ffff00',
  152. open: false
  153. },
  154. xAxis: {
  155. type: "category",
  156. data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七', '地区八'],
  157. axisLine: {
  158. show: true,
  159. lineStyle: {
  160. color: '#224c69',
  161. width: 2,
  162. }
  163. },
  164. axisTick: {
  165. show: true,
  166. alignWithLabel: true,
  167. interval: 'auto',
  168. length:3,
  169. lineStyle: {
  170. color: '#ffff00'
  171. }
  172. },
  173. axisLabel: {
  174. show: true,
  175. textStyle:{
  176. color:'#54b3ea'
  177. }
  178. // margin: 0,
  179. },
  180. splitLine: {
  181. show: false,
  182. lineStyle: {
  183. color: '#26426a',
  184. width: 1,
  185. }
  186. }
  187. },
  188. yAxis: {
  189. type: 'value',
  190. title:'(%)',
  191. nameTextStyle:{
  192. color:'#54b3ea'
  193. },
  194. axisLine: {
  195. show: true,
  196. lineStyle: {
  197. color: '#224c69',
  198. width: 2,
  199. type: 'solid'
  200. }
  201. },
  202. splitLine: {
  203. show: false,
  204. lineStyle: {
  205. color: '#26426a',
  206. width: 1,
  207. type: 'solid'
  208. }
  209. },
  210. axisTick: {
  211. show: true,
  212. interval: 'auto',
  213. length:3,
  214. lineStyle: {
  215. color: '#ffff00',
  216. }
  217. },
  218. axisLabel: {
  219. show: true,
  220. textStyle:{
  221. color:'#54b3ea'
  222. }
  223. // margin: 0,
  224. },
  225. },
  226. shape:{
  227. barCategoryGap: '30%',
  228. label: {
  229. show: false,
  230. textStyle: {
  231. fontSize: 12,
  232. fontWeight: 'normal',
  233. color: ''
  234. //'' 表示使用series默认颜色数组
  235. }
  236. }
  237. },
  238. series: [
  239. {
  240. name: '行业总产值',
  241. type: 'bar',
  242. data: [91,86,82,78,74,79,67,89]
  243. }
  244. ]
  245. };
  246. // bar.setOption( {
  247. // color: ['#02e4ff'],
  248. // bg:{
  249. // backgroundColor:'#000713'
  250. // },
  251. // title: Title.option('新经济普查工作'),
  252. // grid: Grid.option,
  253. // tooltip: {},
  254. // legend: Legend.option,
  255. // xAxis: {
  256. // type: "category",
  257. // data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七'],
  258. // axisLine: {
  259. // show: true,
  260. // lineStyle: {
  261. // color: '#224c69',
  262. // width: 2,
  263. // }
  264. // },
  265. // axisTick: {
  266. // show: true,
  267. // alignWithLabel: true,
  268. // interval: 'auto',
  269. // length:3,
  270. // lineStyle: {
  271. // color: '#ffff00'
  272. // }
  273. // },
  274. // axisLabel: {
  275. // show: true,
  276. // textStyle:{
  277. // color:'#54b3ea'
  278. // }
  279. // // margin: 0,
  280. // },
  281. // splitLine: {
  282. // show: false,
  283. // lineStyle: {
  284. // color: '#26426a',
  285. // width: 1,
  286. // }
  287. // }
  288. // },
  289. // yAxis: {
  290. // type: 'value',
  291. // title:'(%)',
  292. // nameTextStyle:{
  293. // color:'#54b3ea'
  294. // },
  295. // axisLine: {
  296. // show: true,
  297. // lineStyle: {
  298. // color: '#224c69',
  299. // width: 2,
  300. // type: 'solid'
  301. // }
  302. // },
  303. // splitLine: {
  304. // show: false,
  305. // lineStyle: {
  306. // color: '#26426a',
  307. // width: 1,
  308. // type: 'solid'
  309. // }
  310. // },
  311. // axisTick: {
  312. // show: true,
  313. // interval: 'auto',
  314. // length:3,
  315. // lineStyle: {
  316. // color: '#ffff00',
  317. // }
  318. // },
  319. // axisLabel: {
  320. // show: true,
  321. // textStyle:{
  322. // color:'#54b3ea'
  323. // }
  324. // // margin: 0,
  325. // },
  326. // },
  327. // shape:{
  328. // barCategoryGap: '30%',
  329. // label: {
  330. // show: false,
  331. // textStyle: {
  332. // fontSize: 12,
  333. // fontWeight: 'normal',
  334. // color: ''
  335. // //'' 表示使用series默认颜色数组
  336. // }
  337. // },
  338. // },
  339. // series: [
  340. // {
  341. // name: '行业总产值',
  342. // type: 'bar',
  343. // data: [91,86,82,78,74,79,67]
  344. // }
  345. // ]
  346. // })