信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.js 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. import ChartPie8 from '../../../src/chart/pie/ChartPie8/ChartPie8.js';
  2. import title from "../../../src/chart/commonOptions/title";
  3. let chart=new ChartPie8(document.getElementsByClassName('c1')[0],{});
  4. window.addEventListener("resize",()=>{
  5. chart.resize();
  6. });
  7. const defaultOption = {
  8. color:['#6eebf4', '#51bbf4', '#44d7f5', '#42bdfd', '#768bff', '#0c70ee', '#74e9f2', '#778CFF', '#83b283', '#51C4E8', '#A1BEFF'],
  9. animation:{
  10. enterAnimate:{
  11. isAniamte: false,
  12. delayTime: 1000,
  13. duringTime: 3000,
  14. inDelayTime: 300,
  15. type: 'linear'
  16. }
  17. },
  18. legend: {
  19. show: true,
  20. left: "12%",
  21. top: '5%',
  22. orient: 'horizontal',
  23. itemAngelR: 3,
  24. padding: 1,
  25. itemWidth: 12,
  26. itemHeight: 8,
  27. borderRadius: 0,
  28. textStyle: {
  29. fontSize: 16,
  30. color: "#a9bcde"
  31. }
  32. },
  33. pie8: {
  34. center: {
  35. x:"50%",
  36. y:"55%"
  37. },
  38. is14:true,
  39. width:"80%",
  40. detailStyle:{
  41. fontWeight:'normal',
  42. color:'#ffffff',
  43. fontSize:18,
  44. },
  45. hoverColor:'#f8b500',//高亮颜色
  46. bgStyle:{
  47. outLineColor:'#3775BD', //外半圆线 #66a3ff
  48. innerLineColor:'#3775BD',//半径底线 #1d3a70
  49. outArcColor:'rgba(0,0,0,0)',//外扇形 #031023
  50. innerArcColor:'rgba(0,0,0,0)',//扇形#07162d
  51. arcBColor:'#135297',//内圈外线#1f325c
  52. arcBgColor:'#4696F2',//内圈内线#82b9d1
  53. directLineColor:'#fff',//高亮线条颜色
  54. }
  55. },
  56. series: [
  57. {
  58. "name": "基础信息网络",
  59. "value": 3
  60. },
  61. {
  62. "name": "医疗卫生",
  63. "value": 1
  64. },
  65. {
  66. "name": "重要互联网应用系统",
  67. "value": 9
  68. },
  69. {
  70. "name": "其他",
  71. "value": 0
  72. },
  73. {
  74. "name": "科研",
  75. "value": 8
  76. },
  77. {
  78. "name": "社会保障",
  79. "value": 0
  80. }
  81. ],
  82. bg:{
  83. backgroundColor:"#0b162f"
  84. },
  85. };
  86. setTimeout(()=>{
  87. console.log(555)
  88. chart.setOption(defaultOption)
  89. },5000)
  90. const opt2 = {
  91. color:['#6eebf4', '#51bbf4', '#44d7f5', '#42bdfd', '#768bff', '#0c70ee', '#74e9f2', '#778CFF', '#83b283', '#51C4E8', '#A1BEFF'],
  92. animation:{
  93. enterAnimate:{
  94. isAniamte: false,
  95. delayTime: 1000,
  96. duringTime: 3000,
  97. inDelayTime: 300,
  98. type: 'linear'
  99. }
  100. },
  101. legend: {
  102. show: true,
  103. left: "12%",
  104. top: '5%',
  105. orient: 'horizontal',
  106. itemAngelR: 3,
  107. padding: 1,
  108. itemWidth: 12,
  109. itemHeight: 8,
  110. borderRadius: 0,
  111. textStyle: {
  112. fontSize: 16,
  113. color: "#a9bcde"
  114. }
  115. },
  116. pie8: {
  117. center: {
  118. x:"50%",
  119. y:"55%"
  120. },
  121. is14:true,
  122. width:"80%",
  123. detailStyle:{
  124. fontWeight:'normal',
  125. color:'#ffffff',
  126. fontSize:18,
  127. },
  128. hoverColor:'#f8b500',//高亮颜色
  129. bgStyle:{
  130. outLineColor:'#3775BD', //外半圆线 #66a3ff
  131. innerLineColor:'#3775BD',//半径底线 #1d3a70
  132. outArcColor:'rgba(0,0,0,0)',//外扇形 #031023
  133. innerArcColor:'rgba(0,0,0,0)',//扇形#07162d
  134. arcBColor:'#135297',//内圈外线#1f325c
  135. arcBgColor:'#4696F2',//内圈内线#82b9d1
  136. directLineColor:'#fff',//高亮线条颜色
  137. }
  138. },
  139. series: [
  140. {
  141. "name": "基础信息网络",
  142. "value": 999
  143. },
  144. {
  145. "name": "医疗卫生",
  146. "value": 1
  147. },
  148. {
  149. "name": "重要互联网应用系统",
  150. "value": 9
  151. },
  152. {
  153. "name": "其他",
  154. "value": 2
  155. },
  156. {
  157. "name": "科研",
  158. "value": 0
  159. },
  160. ],
  161. bg:{
  162. backgroundColor:"#0b162f"
  163. },
  164. };
  165. // setTimeout(()=>{
  166. // console.log(666)
  167. // chart.setOption(opt2)
  168. // },6000)
  169. // setTimeout(()=>{
  170. // chart.setOption( {
  171. // title: title.option(''),
  172. // color:['#a2a7ad', '#35abcd', '#166a96','#023854','#072c5d'],
  173. // pie8: {
  174. // center: {
  175. // x:"50%",
  176. // y:"50%"
  177. // },
  178. // width:"70%",
  179. // detailStyle:{
  180. // fontWeight:'normal',
  181. // color:'#ffffff',
  182. // fontSize:14,
  183. // },
  184. // },
  185. // series: [{
  186. // name: ['数据一', '数据二', '数据三', '数据四'],
  187. // value: [9212, 7545, 6057,5482]
  188. // }],
  189. // bg:{
  190. // backgroundColor:"#0b162f"
  191. // },
  192. // });
  193. // },3500);