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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. import ChartBar from '../../../src/chart/weather/ChartWeather1/ChartWeather1';
  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(op1);
  14. },3000)
  15. setTimeout(()=>{
  16. // bar.setOption(op2);
  17. },6000)
  18. let op1= {
  19. color: ['#0090ff'],
  20. bg:{
  21. backgroundColor:'#000713'
  22. },
  23. title: Title.option('新经济普查工作'),
  24. grid: Grid.option,
  25. tooltip: ToolTip.option,
  26. legend: Legend.option,
  27. xAxis: {
  28. type: "category",
  29. data: ['地区一', '地区二asdasdasdasdasdasddasdas', '地区三', '地区四', '地区五', '地区六', '地区七', '地区八'],
  30. // dataPlus:[
  31. // ['地一', '地二', '地三', '地三', '地五', '地六', '地七', '地七'],
  32. // ['正', '正', '正', '反', '反', '反', '正', '正'],
  33. // ],
  34. axisLine: {
  35. show: true,
  36. lineStyle: {
  37. color: '#224c69',
  38. width: 2,
  39. }
  40. },
  41. axisTick: {
  42. show: true,
  43. alignWithLabel: true,
  44. interval: 'auto',
  45. length:3,
  46. lineStyle: {
  47. color: '#ffff00'
  48. }
  49. },
  50. axisLabel: {
  51. show: true,
  52. maxShow: '',
  53. overHidden: true,
  54. textStyle:{
  55. color:'#54b3ea'
  56. }
  57. // margin: 0,
  58. },
  59. // splitLine: {
  60. // show: false,
  61. // lineStyle: {
  62. // color: '#26426a',
  63. // width: 1,
  64. //
  65. // }
  66. // }
  67. },
  68. yAxis: {
  69. type: 'value',
  70. title:'(%)',
  71. nameTextStyle:{
  72. color:'#54b3ea'
  73. },
  74. axisLine: {
  75. show: true,
  76. lineStyle: {
  77. color: '#224c69',
  78. width: 2,
  79. type: 'solid'
  80. }
  81. },
  82. splitLine: {
  83. show: false,
  84. lineStyle: {
  85. color: '#26426a',
  86. width: 1,
  87. type: 'solid'
  88. }
  89. },
  90. axisTick: {
  91. show: true,
  92. interval: 'auto',
  93. length:3,
  94. lineStyle: {
  95. color: '#ffff00',
  96. }
  97. },
  98. axisLabel: {
  99. show: true,
  100. textStyle:{
  101. color:'#54b3ea'
  102. }
  103. // margin: 0,
  104. },
  105. },
  106. shape:{
  107. barCategoryGap: '40%',
  108. bgRect:{
  109. lineColor:'#02434b',
  110. color: '#021427'
  111. },
  112. label: {
  113. show: false,
  114. textStyle: {
  115. fontSize: 12,
  116. fontWeight: 'normal',
  117. color: ''
  118. //'' 表示使用series默认颜色数组
  119. }
  120. },
  121. },
  122. series: [
  123. {
  124. name: '行业总产值',
  125. type: 'bar',
  126. data: [91,5,82,78,74,79,67,89]
  127. }
  128. ]
  129. };
  130. let op2= {
  131. color: ['#0090ff'],
  132. bg:{
  133. backgroundColor:'#000713'
  134. },
  135. title: Title.option('新经济普查工作'),
  136. grid: Grid.option,
  137. tooltip: {},
  138. legend: Legend.option,
  139. xAxis: {
  140. type: "category",
  141. data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七', '地区八'],
  142. dataPlus:[
  143. ['正', '正', '正', '反', '反', '反', '正', '正']
  144. ],
  145. axisLine: {
  146. show: true,
  147. lineStyle: {
  148. color: '#224c69',
  149. width: 2,
  150. }
  151. },
  152. axisTick: {
  153. show: true,
  154. alignWithLabel: true,
  155. interval: 'auto',
  156. length:3,
  157. lineStyle: {
  158. color: '#ffff00'
  159. }
  160. },
  161. axisLabel: {
  162. show: true,
  163. textStyle:{
  164. color:'#54b3ea'
  165. }
  166. // margin: 0,
  167. },
  168. // splitLine: {
  169. // show: false,
  170. // lineStyle: {
  171. // color: '#26426a',
  172. // width: 1,
  173. //
  174. // }
  175. // }
  176. },
  177. yAxis: {
  178. type: 'value',
  179. title:'(%)',
  180. nameTextStyle:{
  181. color:'#54b3ea'
  182. },
  183. axisLine: {
  184. show: true,
  185. lineStyle: {
  186. color: '#224c69',
  187. width: 2,
  188. type: 'solid'
  189. }
  190. },
  191. splitLine: {
  192. show: false,
  193. lineStyle: {
  194. color: '#26426a',
  195. width: 1,
  196. type: 'solid'
  197. }
  198. },
  199. axisTick: {
  200. show: true,
  201. interval: 'auto',
  202. length:3,
  203. lineStyle: {
  204. color: '#ffff00',
  205. }
  206. },
  207. axisLabel: {
  208. show: true,
  209. textStyle:{
  210. color:'#54b3ea'
  211. }
  212. // margin: 0,
  213. },
  214. },
  215. shape:{
  216. barCategoryGap: '40%',
  217. bgRect:{
  218. lineColor:'#02434b',
  219. color: '#021427'
  220. },
  221. label: {
  222. show: false,
  223. textStyle: {
  224. fontSize: 12,
  225. fontWeight: 'normal',
  226. color: ''
  227. //'' 表示使用series默认颜色数组
  228. }
  229. },
  230. },
  231. series: [
  232. {
  233. name: '行业总产值',
  234. type: 'bar',
  235. data: [91,5,82,78,74,79,67,89]
  236. }
  237. ]
  238. }