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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. import ChartFunnel from "../../../src/chart/funnel/ChartFunnel3/ChartFunnel3";
  2. let chart=new ChartFunnel(document.getElementsByClassName('main')[0],{});
  3. //
  4. // console.log(chart);
  5. //
  6. window.addEventListener("resize", function () {
  7. chart.resize();
  8. });
  9. //chart.dispose();
  10. //console.log(document.getElementsByClassName('main')[0].children)
  11. //window.addEventListener("click", function () {
  12. // chart.setOption(option)
  13. //});
  14. const defaultOption = {
  15. color: ['#3f90ff','#3fffa7','#ffd657','#fa8444','#ff4e4e'],
  16. title: {},
  17. tooltip: {
  18. titleColor: '#fff',
  19. bgStyle: {
  20. borderColor: '#ccc',
  21. borderWidth: 0,
  22. backgroundColor: 'rgba(0,0,0,0.8)',
  23. }
  24. },
  25. legend: {
  26. show: true,
  27. left: "center",
  28. top: 'bottom',
  29. orient: 'horizontal',
  30. itemWidth: 12,
  31. itemGap: 35,
  32. },
  33. funnel: {
  34. type: 'funnel',
  35. left: '10%',
  36. top: '20%',
  37. bottom: '20%',
  38. width: '60%',
  39. // min: 0,
  40. // max: 100,
  41. minSize: '0%',
  42. maxSize: '100%',
  43. // gap: 0,
  44. percentLabel:{
  45. show: true,
  46. fontSize: 16,
  47. fontWeight: 'normal',
  48. color: '#ffffff'
  49. },
  50. changePercent:{
  51. show:true,
  52. distance:40,
  53. fontSize: 16,
  54. fontWeight: 'normal',
  55. color: '#bdbdbd'
  56. },
  57. },
  58. // calculable: true,
  59. series: [ {
  60. value: 50000,
  61. name: '浏览网站'
  62. },{
  63. value: 35000,
  64. name: '放入购物车'
  65. },{
  66. value: 5000,
  67. name: '生成订单'
  68. },{
  69. value: 15000,
  70. name: '支付订单'
  71. }, {
  72. value: 8000,
  73. name: '完成交易'
  74. },{
  75. value: 5500,
  76. name: '生成订单'
  77. },{
  78. value: 2500,
  79. name: '支付订单'
  80. }, {
  81. value: 800,
  82. name: '完成交易'
  83. } ],
  84. bg:{
  85. backgroundColor:"#000000"
  86. },
  87. };
  88. const defaultOption2 = {
  89. color: ['#3f90ff','#3fffa7','#ffd657','#fa8444','#ff4e4e'],
  90. title: {},
  91. tooltip: {
  92. titleColor: '#fff',
  93. bgStyle: {
  94. borderColor: '#ccc',
  95. borderWidth: 0,
  96. backgroundColor: 'rgba(0,0,0,0.8)',
  97. }
  98. },
  99. legend: {
  100. show: true,
  101. left: "center",
  102. top: 'bottom',
  103. orient: 'horizontal',
  104. itemWidth: 12,
  105. itemGap: 35,
  106. },
  107. funnel: {
  108. type: 'funnel',
  109. left: '10%',
  110. top: '20%',
  111. bottom: '20%',
  112. width: '60%',
  113. // min: 0,
  114. // max: 100,
  115. minSize: '0%',
  116. maxSize: '100%',
  117. // gap: 0,
  118. percentLabel:{
  119. show: true,
  120. fontSize: 16,
  121. fontWeight: 'normal',
  122. color: '#ffffff'
  123. },
  124. changePercent:{
  125. show:true,
  126. distance:40,
  127. fontSize: 16,
  128. fontWeight: 'normal',
  129. color: '#bdbdbd'
  130. },
  131. },
  132. // calculable: true,
  133. series: [ {
  134. value: 50000,
  135. name: '浏览网站'
  136. },{
  137. value: 35000,
  138. name: '放入购物车'
  139. },{
  140. value: 25000,
  141. name: '生成订单'
  142. } ],
  143. bg:{
  144. backgroundColor:"#000000"
  145. },
  146. };
  147. // setTimeout(()=>{
  148. // chart.setOption(defaultOption)
  149. // },1000)
  150. // setTimeout(()=>{
  151. // chart.setOption(defaultOption2)
  152. // },3000)