信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. import ChartBar from '../../../src/chart/bar/ChartBar10/ChartBar10.js';
  2. import Title from "../../../src/chart/commonOptions/title";
  3. import Grid from "../../../src/chart/commonOptions/grid";
  4. let bar = new ChartBar(document.getElementsByClassName('c1')[0], {});
  5. window.addEventListener('resize', () => {
  6. bar.resize();
  7. });
  8. // setTimeout(() => {
  9. // bar.setOption({
  10. // "color": ["#7eb2e7", "#66ffff"],
  11. // "title": {
  12. // "text": "",
  13. // "left": "5%",
  14. // "top": "5%",
  15. // "textStyle": {"fontSize": 14, "fontWeight": "normal", "color": "#000000"}
  16. // },
  17. // "grid": {"left": "18%", "right": "18%", "top": "20%", "bottom": "18%"},
  18. // "legend": {
  19. // "show": true,
  20. // "orient": "horizontal",
  21. // "left": "45%",
  22. // "top": "6%",
  23. // "itemWidth": 12,
  24. // "itemHeight": 12,
  25. // "itemAngelR": 10,
  26. // "textStyle": {"fontSize": 16, "fontWeight": "normal", "color": "#50a7bd"}
  27. // },
  28. // "xAxis": {
  29. // type:'category',
  30. // "axisLine": {"show": true, "lineStyle": {"color": "#00dff7", "width": 2}},
  31. // "axisLabel": {"show": true, "textStyle": {"fontSize": 12, "fontWeight": "normal", "color": "#50a7bd"}},
  32. // "highLightColor": "005eb8",
  33. // "data": [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016]
  34. // },
  35. // "yAxis": {
  36. // type:'value',
  37. // "title": "(%)",
  38. // "nameTextStyle": {"fontSize": 14, "color": "#66ffff"},
  39. // "axisLine": {"show": true, "lineStyle": {"color": "#00dcff", "width": 2}},
  40. // "axisTick": {"show": true, "length": 3, "lineStyle": {"color": "#cee1ff", "width": 2}},
  41. // "splitLine": {"show": true, "lineStyle": {"color": "#26426a", "width": 1}},
  42. // "axisLabel": {
  43. // "show": true,
  44. // "format": false,
  45. // "textStyle": {"fontSize": 12, "fontWeight": "normal", "color": "#66ffff"}
  46. // }
  47. // },
  48. // "tooltip": {
  49. // "show": true,
  50. // "padding": 10,
  51. // "itemGap": 5,
  52. // "offsetX": 15,
  53. // "offsetY": 0,
  54. // "titleColor": "#252525",
  55. // "bgStyle": {"borderColor": "#ccc", "borderWidth": 0, "backgroundColor": "rgba(0,0,0,0.8)"},
  56. // "shadowStyle": {"shadowColor": "#252525", "shadowOpacity": "35%"}
  57. // },
  58. // "series": [{"name": "行业1", "data": [210, 400, 600, 1100, 1500, 700, 500, 650, 1480]}, {
  59. // "name": "行业2",
  60. // "data": [610, 860, 600, 1300, 1300, 700, 580, 750, 1280],
  61. // "label": {"textStyle": {"fontSize": 12, "fontWeight": "normal", "color": ""}},
  62. // "barCategoryGap": "42%",
  63. // "barGap": "80%",
  64. // "colorList": ["#7eb2e7", "#66ffff"]
  65. // }],
  66. // "bg": {"backgroundColor": "rgba(0,0,0,0)"},
  67. // "noTheme": {},
  68. // "useDashboardTheme": false,
  69. // "column": {"xAxis": ["年份"], "series": ["行业1", "行业2"]},
  70. // "dataConfig": {
  71. // "column": {"xAxis": ["年份"], "series": ["行业1", "行业2"]},
  72. // "dataConfig": {
  73. // "xAxis": {"年份": [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016]},
  74. // "series": {
  75. // "行业1": [210, 400, 600, 1100, 1500, 700, 500, 650, 1480],
  76. // "行业2": [610, 860, 600, 1300, 1300, 700, 580, 750, 1280]
  77. // }
  78. // },
  79. // "configList": [{"name": "X轴名称", "type": "value", "comType": "single", "defaultKey": "年份"}, {
  80. // "name": "Y轴名称",
  81. // "type": "key",
  82. // "comType": "multi",
  83. // "defaultKey": ["行业1", "行业2"]
  84. // }],
  85. // "defaultData": {
  86. // "行业1": [210, 400, 600, 1100, 1500, 700, 500, 650, 1480],
  87. // "行业2": [610, 860, 600, 1300, 1300, 700, 580, 750, 1280],
  88. // "年份": [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016]
  89. // }
  90. // },
  91. // "customizeData": {
  92. // "title": {
  93. // "name": "标题",
  94. // "sub": {
  95. // "text": {"name": "内容", "comType": "input", "defaultValue": ""},
  96. // "left": {
  97. // "name": "水平安放位置",
  98. // "defaultChoose": 0,
  99. // "chooseSub": [{
  100. // "comType": "slider",
  101. // "defaultValue": "5%",
  102. // "comInfo": {"min": "0%", "max": "100%"}
  103. // }, {
  104. // "comType": "radio",
  105. // "defaultValue": "left",
  106. // "comInfo": [{"name": "居左", "value": "left"}, {
  107. // "name": "居中",
  108. // "value": "center"
  109. // }, {"name": "居右", "value": "right"}]
  110. // }]
  111. // },
  112. // "top": {
  113. // "name": "垂直安放位置",
  114. // "defaultChoose": 0,
  115. // "chooseSub": [{
  116. // "comType": "slider",
  117. // "defaultValue": "5%",
  118. // "comInfo": {"min": "0%", "max": "100%"}
  119. // }, {
  120. // "comType": "radio",
  121. // "defaultValue": "top",
  122. // "comInfo": [{"name": "居上", "value": "top"}, {
  123. // "name": "居中",
  124. // "value": "middle"
  125. // }, {"name": "居下", "value": "bottom"}]
  126. // }]
  127. // },
  128. // "textStyle": {
  129. // "name": "字体样式",
  130. // "sub": {
  131. // "fontSize": {
  132. // "name": "字体大小",
  133. // "comType": "slider",
  134. // "defaultValue": 14,
  135. // "comInfo": {"min": 12, "max": 50}
  136. // },
  137. // "fontWeight": {
  138. // "name": "字体加粗",
  139. // "comType": "radio",
  140. // "defaultValue": "normal",
  141. // "comInfo": [{"name": "正常", "value": "normal"}, {"name": "加粗", "value": "bold"}]
  142. // },
  143. // "color": {"name": "字体颜色", "comType": "colorPicker", "defaultValue": "#000000"}
  144. // }
  145. // }
  146. // }
  147. // },
  148. // "grid": {
  149. // "name": "视区",
  150. // "sub": {
  151. // "left": {
  152. // "name": "左边距",
  153. // "comType": "slider",
  154. // "defaultValue": "18%",
  155. // "comInfo": {"min": "0%", "max": "100%"}
  156. // },
  157. // "right": {
  158. // "name": "右边距",
  159. // "comType": "slider",
  160. // "defaultValue": "18%",
  161. // "comInfo": {"min": "0%", "max": "100%"}
  162. // },
  163. // "top": {
  164. // "name": "上边距",
  165. // "comType": "slider",
  166. // "defaultValue": "20%",
  167. // "comInfo": {"min": "0%", "max": "100%"}
  168. // },
  169. // "bottom": {
  170. // "name": "下边距",
  171. // "comType": "slider",
  172. // "defaultValue": "18%",
  173. // "comInfo": {"min": "0%", "max": "100%"}
  174. // }
  175. // }
  176. // },
  177. // "legend": {
  178. // "name": "图例",
  179. // "sub": {
  180. // "show": {
  181. // "name": "是否显示图例",
  182. // "comType": "radio",
  183. // "defaultValue": true,
  184. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  185. // },
  186. // "orient": {
  187. // "name": "排列方式",
  188. // "comType": "radio",
  189. // "defaultValue": "horizontal",
  190. // "comInfo": [{"name": "横向", "value": "horizontal"}, {"name": "纵向", "value": "vertical"}]
  191. // },
  192. // "left": {
  193. // "name": "水平安放位置",
  194. // "defaultChoose": 0,
  195. // "chooseSub": [{
  196. // "comType": "slider",
  197. // "defaultValue": "45%",
  198. // "comInfo": {"min": "0%", "max": "100%"}
  199. // }, {
  200. // "comType": "radio",
  201. // "defaultValue": "right",
  202. // "comInfo": [{"name": "居左", "value": "left"}, {
  203. // "name": "居中",
  204. // "value": "center"
  205. // }, {"name": "居右", "value": "right"}]
  206. // }]
  207. // },
  208. // "top": {
  209. // "name": "垂直安放位置",
  210. // "defaultChoose": 0,
  211. // "chooseSub": [{
  212. // "comType": "slider",
  213. // "defaultValue": "6%",
  214. // "comInfo": {"min": "0%", "max": "100%"}
  215. // }, {
  216. // "comType": "radio",
  217. // "defaultValue": "top",
  218. // "comInfo": [{"name": "居上", "value": "top"}, {
  219. // "name": "居中",
  220. // "value": "middle"
  221. // }, {"name": "居下", "value": "bottom"}]
  222. // }]
  223. // },
  224. // "itemWidth": {
  225. // "name": "图例图形宽度",
  226. // "comType": "slider",
  227. // "defaultValue": 12,
  228. // "comInfo": {"min": 10, "max": 100}
  229. // },
  230. // "itemHeight": {
  231. // "name": "图例图形高度",
  232. // "comType": "slider",
  233. // "defaultValue": 12,
  234. // "comInfo": {"min": 10, "max": 100}
  235. // },
  236. // "itemAngelR": {
  237. // "name": "图形圆角半径",
  238. // "defaultValue": 10,
  239. // "comType": "slider",
  240. // "comInfo": {"min": 0, "max": 20}
  241. // },
  242. // "textStyle": {
  243. // "name": "字体样式",
  244. // "sub": {
  245. // "fontSize": {
  246. // "name": "字体大小",
  247. // "comType": "slider",
  248. // "defaultValue": 16,
  249. // "comInfo": {"min": 12, "max": 100}
  250. // },
  251. // "fontWeight": {
  252. // "name": "字体加粗",
  253. // "comType": "radio",
  254. // "defaultValue": "normal",
  255. // "comInfo": [{"name": "正常", "value": "normal"}, {"name": "加粗", "value": "bold"}]
  256. // },
  257. // "color": {"name": "字体颜色", "comType": "colorPicker", "defaultValue": "#50a7bd"}
  258. // }
  259. // }
  260. // }
  261. // },
  262. // "xAxis": {
  263. // "name": "x轴",
  264. // "sub": {
  265. // "axisLine": {
  266. // "name": "轴线",
  267. // "sub": {
  268. // "show": {
  269. // "name": "是否显示",
  270. // "comType": "radio",
  271. // "defaultValue": true,
  272. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  273. // },
  274. // "lineStyle": {
  275. // "name": "线条样式",
  276. // "sub": {
  277. // "color": {"name": "颜色", "comType": "colorPicker", "defaultValue": "#00dff7"},
  278. // "width": {
  279. // "name": "线宽",
  280. // "comType": "slider",
  281. // "defaultValue": 2,
  282. // "comInfo": {"min": 1, "max": 20}
  283. // }
  284. // }
  285. // }
  286. // }
  287. // },
  288. // "axisLabel": {
  289. // "name": "标签",
  290. // "sub": {
  291. // "show": {
  292. // "name": "是否显示",
  293. // "defaultValue": true,
  294. // "comType": "radio",
  295. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  296. // },
  297. // "textStyle": {
  298. // "name": "字体样式",
  299. // "type": "ChartBarH",
  300. // "sub": {
  301. // "fontSize": {
  302. // "name": "字体大小",
  303. // "comType": "slider",
  304. // "defaultValue": 12,
  305. // "comInfo": {"min": 12, "max": 50}
  306. // },
  307. // "fontWeight": {
  308. // "name": "字体加粗",
  309. // "comType": "radio",
  310. // "defaultValue": "normal",
  311. // "comInfo": [{"name": "正常", "value": "normal"}, {"name": "加粗", "value": "bold"}]
  312. // },
  313. // "color": {"name": "字体颜色", "comType": "colorPicker", "defaultValue": "#50a7bd"}
  314. // }
  315. // }
  316. // }
  317. // },
  318. // "highLightColor": {"name": "高亮框颜色", "defaultValue": "005eb8", "comType": "colorPicker"}
  319. // }
  320. // },
  321. // "yAxis": {
  322. // "name": "y轴",
  323. // "sub": {
  324. // "title": {"name": "坐标轴名称", "defaultValue": "(%)", "comType": "input"},
  325. // "nameTextStyle": {
  326. // "name": "坐标轴名称样式",
  327. // "sub": {
  328. // "fontSize": {
  329. // "name": "字体大小",
  330. // "defaultValue": 14,
  331. // "comType": "slider",
  332. // "comInfo": {"min": 12, "max": 50}
  333. // }, "color": {"name": "字体颜色", "defaultValue": "#66ffff", "comType": "colorPicker"}
  334. // }
  335. // },
  336. // "axisLine": {
  337. // "name": "轴线",
  338. // "sub": {
  339. // "show": {
  340. // "name": "是否显示",
  341. // "comType": "radio",
  342. // "defaultValue": true,
  343. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  344. // },
  345. // "lineStyle": {
  346. // "name": "线条样式",
  347. // "sub": {
  348. // "color": {"name": "颜色", "comType": "colorPicker", "defaultValue": "#00dcff"},
  349. // "width": {
  350. // "name": "线宽",
  351. // "comType": "slider",
  352. // "defaultValue": 2,
  353. // "comInfo": {"min": 1, "max": 20}
  354. // }
  355. // }
  356. // }
  357. // }
  358. // },
  359. // "axisTick": {
  360. // "name": "轴刻度线",
  361. // "sub": {
  362. // "show": {
  363. // "name": "是否显示",
  364. // "comType": "radio",
  365. // "defaultValue": true,
  366. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  367. // },
  368. // "length": {
  369. // "name": "线条长度",
  370. // "comType": "slider",
  371. // "defaultValue": 3,
  372. // "comInfo": {"min": 1, "max": 50}
  373. // },
  374. // "lineStyle": {
  375. // "name": "线条样式",
  376. // "sub": {
  377. // "color": {"name": "颜色", "comType": "colorPicker", "defaultValue": "#cee1ff"},
  378. // "width": {
  379. // "name": "线宽",
  380. // "comType": "slider",
  381. // "defaultValue": 2,
  382. // "comInfo": {"min": 1, "max": 20}
  383. // }
  384. // }
  385. // }
  386. // }
  387. // },
  388. // "splitLine": {
  389. // "name": "分割线",
  390. // "sub": {
  391. // "show": {
  392. // "name": "是否显示",
  393. // "comType": "radio",
  394. // "defaultValue": true,
  395. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  396. // },
  397. // "lineStyle": {
  398. // "name": "线条样式",
  399. // "sub": {
  400. // "color": {"name": "颜色", "comType": "colorPicker", "defaultValue": "#26426a"},
  401. // "width": {
  402. // "name": "线宽",
  403. // "comType": "slider",
  404. // "defaultValue": 1,
  405. // "comInfo": {"min": 1, "max": 20}
  406. // }
  407. // }
  408. // }
  409. // }
  410. // },
  411. // "axisLabel": {
  412. // "name": "标签",
  413. // "sub": {
  414. // "show": {
  415. // "name": "是否显示",
  416. // "defaultValue": true,
  417. // "comType": "radio",
  418. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  419. // },
  420. // "format": {
  421. // "name": "是否显示千分位符",
  422. // "defaultValue": false,
  423. // "comType": "radio",
  424. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  425. // },
  426. // "textStyle": {
  427. // "name": "字体样式",
  428. // "type": "ChartBarH",
  429. // "sub": {
  430. // "fontSize": {
  431. // "name": "字体大小",
  432. // "comType": "slider",
  433. // "defaultValue": 12,
  434. // "comInfo": {"min": 12, "max": 50}
  435. // },
  436. // "fontWeight": {
  437. // "name": "字体加粗",
  438. // "comType": "radio",
  439. // "defaultValue": "normal",
  440. // "comInfo": [{"name": "正常", "value": "normal"}, {"name": "加粗", "value": "bold"}]
  441. // },
  442. // "color": {"name": "字体颜色", "comType": "colorPicker", "defaultValue": "#66ffff"}
  443. // }
  444. // }
  445. // }
  446. // }
  447. // }
  448. // },
  449. // "tooltip": {
  450. // "name": "提示",
  451. // "sub": {
  452. // "show": {
  453. // "name": "是否显示提示框",
  454. // "defaultValue": true,
  455. // "comType": "radio",
  456. // "comInfo": [{"name": "是", "value": true}, {"name": "否", "value": false}]
  457. // },
  458. // "padding": {
  459. // "name": "内边距",
  460. // "defaultValue": 10,
  461. // "comType": "slider",
  462. // "comInfo": {"min": 1, "max": 100}
  463. // },
  464. // "itemGap": {
  465. // "name": "行间距",
  466. // "defaultValue": 5,
  467. // "comType": "slider",
  468. // "comInfo": {"min": 1, "max": 50}
  469. // },
  470. // "offsetX": {
  471. // "name": "横向偏移值",
  472. // "defaultValue": 15,
  473. // "comType": "slider",
  474. // "comInfo": {"min": -100, "max": 100}
  475. // },
  476. // "offsetY": {
  477. // "name": "纵向偏移值",
  478. // "defaultValue": 0,
  479. // "comType": "slider",
  480. // "comInfo": {"min": -100, "max": 100}
  481. // },
  482. // "titleColor": {"name": "提示框标题颜色", "defaultValue": "#252525", "comType": "colorPicker"},
  483. // "bgStyle": {
  484. // "name": "背景",
  485. // "sub": {
  486. // "borderColor": {"name": "边框颜色", "defaultValue": "#ccc", "comType": "colorPicker"},
  487. // "borderWidth": {
  488. // "name": "边框宽度",
  489. // "defaultValue": 0,
  490. // "comType": "slider",
  491. // "comInfo": {"min": 0, "max": 20}
  492. // },
  493. // "backgroundColor": {
  494. // "name": "背景颜色",
  495. // "defaultValue": "rgba(0,0,0,0.8)",
  496. // "comType": "colorPicker"
  497. // }
  498. // }
  499. // },
  500. // "shadowStyle": {
  501. // "name": "阴影",
  502. // "sub": {
  503. // "shadowColor": {"name": "阴影颜色", "defaultValue": "#252525", "comType": "colorPicker"},
  504. // "shadowOpacity": {
  505. // "name": "阴影透明度",
  506. // "defaultValue": "35%",
  507. // "comType": "slider",
  508. // "comInfo": {"min": "0%", "max": "100%"}
  509. // }
  510. // }
  511. // }
  512. // }
  513. // },
  514. // "series": {
  515. // "name": "系列",
  516. // "type": "ChartClustBarH",
  517. // "sub": {
  518. // "label": {
  519. // "name": "图形的文本标签",
  520. // "sub": {
  521. // "textStyle": {
  522. // "name": "字体样式",
  523. // "sub": {
  524. // "fontSize": {
  525. // "name": "字体大小",
  526. // "comType": "slider",
  527. // "defaultValue": 12,
  528. // "comInfo": {"min": 12, "max": 50}
  529. // },
  530. // "fontWeight": {
  531. // "name": "字体加粗",
  532. // "comType": "radio",
  533. // "defaultValue": "normal",
  534. // "comInfo": [{"name": "正常", "value": "normal"}, {"name": "加粗", "value": "bold"}]
  535. // },
  536. // "color": {"name": "字体颜色", "comType": "colorPicker", "defaultValue": ""}
  537. // }
  538. // }
  539. // }
  540. // },
  541. // "barCategoryGap": {
  542. // "name": "类目间柱间距",
  543. // "comType": "slider",
  544. // "defaultValue": "42%",
  545. // "comInfo": {"min": "0%", "max": "90%"}
  546. // },
  547. // "barGap": {
  548. // "name": "类目内柱间距",
  549. // "comType": "slider",
  550. // "defaultValue": "80%",
  551. // "comInfo": {"min": "0%", "max": "300%"}
  552. // },
  553. // "colorList": {"name": "系列色", "comType": "colorPickerList", "defaultValue": ["#7eb2e7", "#66ffff"]}
  554. // }
  555. // },
  556. // "bg": {
  557. // "name": "背景",
  558. // "sub": {"backgroundColor": {"name": "背景色", "defaultValue": "rgba(0,0,0,0)", "comType": "colorPicker"}}
  559. // },
  560. // "noTheme": true
  561. // },
  562. // "chartName": "ChartBar10",
  563. // "chartCuid": "CHART-ff80808167bb9b4a0167c5cf7fac0033",
  564. // "dataOption": [{"data": [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016], "name": "年份"}, {
  565. // "name": "",
  566. // "data": [{"name": "行业1", "data": [210, 400, 600, 1100, 1500, 700, 500, 650, 1480]}, {
  567. // "name": "行业2",
  568. // "data": [610, 860, 600, 1300, 1300, 700, 580, 750, 1280]
  569. // }]
  570. // }],
  571. // "dataError": false
  572. // })
  573. // }, 3000);