信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.js 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import ChartBar from '../../../src/chart/bar/ChartBar5/ChartBar5.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 Animation from "../../../src/chart/commonOptions/animation";
  7. import Carousel from "../../../src/chart/commonOptions/carousel";
  8. // import Title from "../../../src/chart/commonOptions/title";
  9. // import Grid from "../../../src/chart/commonOptions/grid";
  10. let bar = new ChartBar(document.getElementsByClassName('c1')[0], {});
  11. window.addEventListener('resize', () => {
  12. bar.resize();
  13. });
  14. setTimeout(()=>{
  15. // console.log(3000);
  16. bar.setOption(option);
  17. },3000)
  18. setTimeout(()=>{
  19. console.log(6000);
  20. // bar.setOption(op2);
  21. },6000)
  22. let option = {
  23. color: ['#02e4ff'],
  24. bg:{
  25. backgroundColor:'#000713'
  26. },
  27. // title: Title.option('新经济普查工作'),
  28. animation: Animation.option,
  29. grid: {
  30. left:'18%',
  31. top:'20%',
  32. right:'18%',
  33. bottom:'18%',
  34. containLabel: false
  35. },
  36. tooltip: Tooltip.option,
  37. carousel: Carousel.option,
  38. legend: {show:true,top:'5%'},
  39. xAxis: {
  40. type: "category",
  41. data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六'],
  42. axisLine: {
  43. show: true,
  44. lineStyle: {
  45. color: '#224c69',
  46. width: 2,
  47. }
  48. },
  49. axisTick: {
  50. show: true,
  51. alignWithLabel: true,
  52. interval: 'auto',
  53. length:3,
  54. lineStyle: {
  55. color: '#ffff00'
  56. }
  57. },
  58. axisLabel: {
  59. show: true,
  60. overHidden: false,
  61. maxShow:'',
  62. textStyle:{
  63. color:'#54b3ea'
  64. }
  65. // margin: 0,
  66. },
  67. // splitLine: {
  68. // show: false,
  69. // lineStyle: {
  70. // color: '#26426a',
  71. // width: 1,
  72. //
  73. // }
  74. // }
  75. },
  76. yAxis: {
  77. type: 'value',
  78. title:'(%)',
  79. nameTextStyle:{
  80. color:'#54b3ea'
  81. },
  82. axisLine: {
  83. show: true,
  84. lineStyle: {
  85. color: '#224c69',
  86. width: 2,
  87. type: 'solid'
  88. }
  89. },
  90. splitLine: {
  91. show: false,
  92. lineStyle: {
  93. color: '#26426a',
  94. width: 1,
  95. type: 'solid'
  96. }
  97. },
  98. axisTick: {
  99. show: true,
  100. interval: 'auto',
  101. length:3,
  102. lineStyle: {
  103. color: '#ffff00',
  104. }
  105. },
  106. axisLabel: {
  107. show: true,
  108. textStyle:{
  109. color:'#54b3ea'
  110. }
  111. // margin: 0,
  112. },
  113. },
  114. shape:{
  115. barCategoryGap: '40%',
  116. bgRect:{
  117. lineColor:'#02434b',
  118. color: '#021427',
  119. },
  120. rect:{
  121. hoverColor: '#ffd802'
  122. },
  123. label: {
  124. show: false,
  125. textStyle: {
  126. fontSize: 12,
  127. fontWeight: 'normal',
  128. color: ''
  129. //'' 表示使用series默认颜色数组
  130. }
  131. },
  132. },
  133. series: [
  134. {
  135. name: '行业总产值',
  136. type: 'bar',
  137. data: [91,5,82,78,74,79]
  138. }
  139. ]
  140. };