信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import ChartBar from '../../../src/chart/bar/ChartBar2/ChartBar2.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. let option = {
  9. type: "p1",
  10. color:['#00f5fe'],
  11. bg:{
  12. backgroundColor:'#000713'
  13. },
  14. title: Title.option('服装销售利润'),
  15. tooltip: {
  16. show:false
  17. },
  18. grid: {
  19. left:'18%',
  20. top:'20%',
  21. right:'18%',
  22. bottom:'18%',
  23. containLabel: false
  24. },
  25. // legend: Legend.option,
  26. // carousel: Carousel.option,
  27. animation: Animation.option,
  28. xAxis: {
  29. type: 'value',
  30. min:80,
  31. axisLine: {
  32. show: true,
  33. lineStyle: {
  34. color: '#0066b0',
  35. width: 2,
  36. type: 'solid'
  37. }
  38. },
  39. axisTick: {
  40. show: true,
  41. alignWithLabel: false,
  42. interval: 'auto',
  43. length:3,
  44. lineStyle: {
  45. color: '#fffd00',
  46. width:2
  47. }
  48. },
  49. splitLine: {
  50. show: false,
  51. lineStyle: {
  52. color: '#293f5f',
  53. width: 1,
  54. type: 'solid'
  55. }
  56. },
  57. axisLabel: {
  58. show: true,
  59. textStyle: {
  60. color: '#439eff'
  61. }
  62. }
  63. },
  64. yAxis: {
  65. type: "category",
  66. reverse:true,
  67. name: '地区',
  68. data: ["地区一", "地区二", "地区三", "地区四", "地区五",'地区六','地区七','地区八'],
  69. axisLine: {
  70. show: true,
  71. lineStyle: {
  72. color: '#0066b0',
  73. width: 2,
  74. type: 'solid'
  75. }
  76. },
  77. axisTick: {
  78. show: true,
  79. alignWithLabel: true,
  80. interval: 'auto',
  81. length:3,
  82. lineStyle: {
  83. color: '#fffd00',
  84. width:2
  85. }
  86. },
  87. splitLine: {
  88. show: false,
  89. lineStyle: {
  90. color: '#293f5f',
  91. width: 1,
  92. type: 'solid'
  93. }
  94. },
  95. axisLabel:{
  96. show:true,
  97. textStyle:{
  98. color:'#439eff'
  99. }
  100. }
  101. },
  102. shape:{
  103. barCategoryGap: '70%',
  104. label: {
  105. show: true,
  106. textStyle: {
  107. fontSize: 12,
  108. fontWeight: 'normal',
  109. color: '#00f4fe'
  110. },
  111. positionX:5
  112. },
  113. },
  114. series: [
  115. {
  116. name: '利润',
  117. type: 'bar',
  118. data: [98, 95.1, 94,90,89.5,87,86, 84]
  119. }
  120. ]
  121. };
  122. setTimeout(() => {
  123. bar.setOption(option)
  124. }, 5000);