信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import ChartBar from '../../../src/chart/bar/ChartBar43/ChartBar43.js';
  2. import Title from "../../../src/chart/commonOptions/title";
  3. import Grid from "../../../src/chart/commonOptions/grid";
  4. import Animation from "../../../src/chart/commonOptions/animation";
  5. import Carousel from "../../../src/chart/commonOptions/carousel";
  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. console.log(3000);
  14. bar.setOption(option);
  15. },3000)
  16. // setTimeout(()=>{
  17. // console.log(6000);
  18. // // bar.setOption(op2);
  19. // },6000)
  20. let option = {
  21. color: ['#ff0000'],
  22. bg:{
  23. backgroundColor:'#000713'
  24. },
  25. title: {text:''},
  26. animation: Animation.option,
  27. warn:{
  28. config:{
  29. open: false
  30. }
  31. },
  32. grid: {
  33. left:'18%',
  34. top:'20%',
  35. right:'18%',
  36. bottom:'18%',
  37. containLabel: false
  38. },
  39. tooltip: {
  40. show:true,
  41. padding:10,
  42. itemGap:5,
  43. offsetX:15,
  44. offsetY:0,
  45. bgStyle: {
  46. backgroundColor: '#a75a1d',
  47. bgbor:"#ff7e00"
  48. },
  49. angleR: 0,
  50. dangerline: {
  51. show: false,
  52. dangerData: 2560000,
  53. color: '#f5196a'
  54. },
  55. tooltipText:{
  56. titleStyle:{
  57. fontSize:12
  58. },
  59. contentStyle:{
  60. fontSize:14
  61. },
  62. },
  63. titleColor:'#ffffff',
  64. contentColor:'#ffffff',
  65. titShowtxt:"分布数量"
  66. },
  67. carousel: Carousel.option,
  68. legend: {show:true,top:'5%'},
  69. xAxis: {
  70. type: "category",
  71. data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七', '地区八'],
  72. axisLine: {
  73. show: true,
  74. lineStyle: {
  75. color: '#224c69',
  76. width: 2,
  77. }
  78. },
  79. axisTick: {
  80. show: true,
  81. alignWithLabel: true,
  82. interval: 'auto',
  83. length:3,
  84. lineStyle: {
  85. color: '#ffff00'
  86. }
  87. },
  88. axisLabel: {
  89. show: true,
  90. overHidden: false,
  91. maxShow:'',
  92. textStyle:{
  93. color:'#54b3ea'
  94. }
  95. // margin: 0,
  96. },
  97. // splitLine: {
  98. // show: false,
  99. // lineStyle: {
  100. // color: '#26426a',
  101. // width: 1,
  102. //
  103. // }
  104. // }
  105. },
  106. yAxis: {
  107. type: 'value',
  108. title:'(%)',
  109. nameTextStyle:{
  110. color:'#54b3ea'
  111. },
  112. axisLine: {
  113. show: true,
  114. lineStyle: {
  115. color: '#224c69',
  116. width: 2,
  117. type: 'solid'
  118. }
  119. },
  120. splitLine: {
  121. show: false,
  122. lineStyle: {
  123. color: '#26426a',
  124. width: 1,
  125. type: 'solid'
  126. }
  127. },
  128. axisTick: {
  129. show: true,
  130. interval: 'auto',
  131. length:3,
  132. lineStyle: {
  133. color: '#ffff00',
  134. }
  135. },
  136. axisLabel: {
  137. show: true,
  138. textStyle:{
  139. color:'#54b3ea'
  140. }
  141. // margin: 0,
  142. },
  143. },
  144. shape:{
  145. barCategoryGap: '40%',
  146. bgRect:{
  147. lineColor:'#02434b',
  148. color: '#021427',
  149. },
  150. rect:{
  151. hoverColor: '#ffd802',
  152. lineWidth: 8,
  153. triangleWidth: 25
  154. },
  155. label: {
  156. show: false,
  157. textStyle: {
  158. fontSize: 12,
  159. fontWeight: 'normal',
  160. color: ''
  161. //'' 表示使用series默认颜色数组
  162. }
  163. },
  164. },
  165. series: [
  166. {
  167. name: '行业总产值',
  168. type: 'bar',
  169. data: [8,5,82,78,74,79,67,89]
  170. }
  171. ]
  172. };