信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. import ChartFunnel from "../../../src/chart/funnel/ChartFunnel4/ChartFunnel4";
  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: 5000,
  61. name: '浏览网站'
  62. },{
  63. value: 6000,
  64. name: '放入购物车'
  65. },{
  66. value: 25000,
  67. name: '生成订单'
  68. },{
  69. value: 15000,
  70. name: '支付订单'
  71. }, {
  72. value: 8000,
  73. name: '完成交易'
  74. },{
  75. value: 5500,
  76. name: '生成订单'
  77. }
  78. ],
  79. bg:{
  80. backgroundColor:"#000000"
  81. },
  82. };
  83. const defaultOption2 = {
  84. color: ['#3f90ff','#3fffa7','#ffd657','#fa8444','#ff4e4e'],
  85. title: {},
  86. tooltip: {
  87. titleColor: '#fff',
  88. bgStyle: {
  89. borderColor: '#ccc',
  90. borderWidth: 0,
  91. backgroundColor: 'rgba(0,0,0,0.8)',
  92. }
  93. },
  94. legend: {
  95. show: true,
  96. left: "center",
  97. top: 'bottom',
  98. orient: 'horizontal',
  99. itemWidth: 12,
  100. itemGap: 35,
  101. },
  102. funnel: {
  103. type: 'funnel',
  104. left: '10%',
  105. top: '20%',
  106. bottom: '20%',
  107. width: '60%',
  108. // min: 0,
  109. // max: 100,
  110. minSize: '0%',
  111. maxSize: '100%',
  112. // gap: 0,
  113. percentLabel:{
  114. show: true,
  115. fontSize: 16,
  116. fontWeight: 'normal',
  117. color: '#ffffff'
  118. },
  119. changePercent:{
  120. show:true,
  121. distance:40,
  122. fontSize: 16,
  123. fontWeight: 'normal',
  124. color: '#bdbdbd'
  125. },
  126. },
  127. // calculable: true,
  128. series: [ {
  129. value: 8000,
  130. name: '浏览网站'
  131. },{
  132. value: 35000,
  133. name: '放入购物车'
  134. },{
  135. value: 25000,
  136. name: '生成订单'
  137. } ],
  138. bg:{
  139. backgroundColor:"#000000"
  140. },
  141. };
  142. // setTimeout(()=>{
  143. // chart.setOption(defaultOption)
  144. // },2000)
  145. // setTimeout(()=>{
  146. // chart.setOption(defaultOption2)
  147. // },3000)