信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. import Chart from "../../../src/chart/bar/ChartBar17/ChartBar17";
  2. import option from "../../../src/option/globalDefaultOption";
  3. // import bar15 from "./ChartBar15_1eba2";
  4. const consoleWarn = window.console.warn;
  5. window.console.warn = function() {
  6. const string = arguments[0];
  7. const filterStrings = [
  8. 'is not power of two',
  9. 'image is too big',
  10. 'marked for update',
  11. 'can\'t invert matrix'
  12. ];
  13. // filter warnings containing above strings
  14. const shouldBeFiltered = filterStrings.some(string => (
  15. arguments[0].includes('THREE') && arguments[0].includes(string)
  16. ));
  17. if (shouldBeFiltered) {
  18. // console.log("find",arguments[0])
  19. // log it to console without second argument, which contains reference to `image`
  20. // consoleWarn.call(null, arguments[0]);
  21. } else {
  22. // pass other warnings without changes
  23. consoleWarn.apply(null, arguments);
  24. }
  25. };
  26. let bar=new Chart(document.querySelector(".c1"),{});
  27. window.addEventListener("resize",function () {
  28. bar.resize()
  29. })
  30. let changeOpt = {
  31. color: ['#0a73dc', '#04a2ae', '#424a95', '#2a7ebe', '#113b85', '#a2f9ff', '#01a0c8', '#5879c0', '#74e9f2', '#126087', '#99b5da'],
  32. bg: {
  33. backgroundColor: "#000000"
  34. },
  35. legend: {
  36. show: true,
  37. left: "70%",
  38. top: '5%',
  39. orient: 'horizontal',
  40. itemWidth: 8,
  41. itemHeight: 8,
  42. borderRadius: 0,
  43. textStyle: {
  44. fontSize: 14,
  45. color: "#ffffff"
  46. }
  47. },
  48. tooltip: {
  49. show: true,
  50. paddingW:10,
  51. paddingH: 10,
  52. itemGap: 2,
  53. //距目标的偏移值
  54. offsetX: 15,
  55. offsetY: 0,
  56. titleFontSize:14,
  57. titleColor: '#ff0000',
  58. itemFontSize:12,
  59. itemColor:"#ffffff",
  60. borderColor: '#ccc',
  61. borderWidth: 0,
  62. backgroundColor: 'rgba(255,255,255,0)',
  63. },
  64. grid: {
  65. left: "0%",
  66. right: "20",
  67. top: "20%",
  68. bottom: "40%"
  69. },
  70. valueAxis: {
  71. textStyle: {
  72. fontSize: 12,
  73. color: "#ffffff",
  74. shadowBlur: 5,
  75. shadowColor: "#ff0000"
  76. }
  77. },
  78. categoryAxis: {
  79. textStyle: {
  80. fontSize: 14,
  81. color: "#ffffff",
  82. shadowBlur: 0,
  83. shadowColor: "#ffffff"
  84. },
  85. // data: ["小米", "华为", "苹果", "三星", "vivo", "oppo"]
  86. data: ["小米", "华为", "苹果", "三星", "vivo", "oppo"]
  87. },
  88. series: [
  89. // {
  90. // name: "一季度销量",
  91. // data: [639539, 548671, 457822, 223133, 158514, 122348]
  92. // },
  93. {
  94. name: "二季度销量",
  95. data: [581244, 0, 512544, 223133, 158514, 122348]
  96. }
  97. ]
  98. }
  99. const option2 = {
  100. color: ['#0a73dc', '#04a2ae', '#424a95', '#2a7ebe', '#113b85', '#a2f9ff', '#01a0c8', '#5879c0', '#74e9f2', '#126087', '#99b5da'],
  101. bg: {
  102. backgroundColor: "#000000"
  103. },
  104. legend: {
  105. show: true,
  106. left: "60%",
  107. top: '15%',
  108. orient: 'horizontal',
  109. itemWidth: 8,
  110. itemHeight: 8,
  111. borderRadius: 0,
  112. textStyle: {
  113. fontSize: 24,
  114. color: "#ffffff",
  115. fontWeight:'bold'
  116. }
  117. },
  118. tooltip: {
  119. show: true,
  120. paddingW:10,
  121. paddingH: 10,
  122. itemGap: 2,
  123. //距目标的偏移值
  124. offsetX: 15,
  125. offsetY: 0,
  126. titleFontSize:14,
  127. titleColor: '#ff0000',
  128. itemFontSize:12,
  129. itemColor:"#ffffff",
  130. borderColor: '#ccc',
  131. borderWidth: 0,
  132. backgroundColor: 'rgba(255,255,255,0)',
  133. },
  134. // grid: {
  135. // left: "1%",
  136. // right: "10",
  137. // top: "10%",
  138. // bottom: "10%"
  139. // },
  140. grid:{
  141. left:"20%",
  142. right:"20%",
  143. top:"20%",
  144. bottom:"15%"
  145. },
  146. valueAxis: {
  147. textStyle: {
  148. fontSize: 12,
  149. color: "#ffffff",
  150. shadowBlur: 5,
  151. shadowColor: "#ff0000"
  152. }
  153. },
  154. categoryAxis: {
  155. textStyle: {
  156. fontSize: 14,
  157. color: "#ffffff",
  158. shadowBlur: 0,
  159. shadowColor: "#ffffff"
  160. },
  161. // data: ["小米", "华为", "苹果", "三星", "vivo", "oppo",'魅族']
  162. // data: ["小米", "华为", "苹果", "三星", "vivo", "oppo"]
  163. data: ["小米", "华为", "苹果", "三星"]
  164. },
  165. series: [
  166. {
  167. name: "一季度销量",
  168. // data: [6395390, 0, 4578220,563334, 512544, 496554,23234]
  169. // data: [6395390, 0, 4578220,563334, 512544, 496554]
  170. data: [581244, 563334, 512544, 496554]
  171. },
  172. // {
  173. // name: "二季度销量",
  174. // data: [581244, 563334, 512544, 496554, 407788, 368555]
  175. // }
  176. ]
  177. };
  178. // setTimeout(()=>{
  179. // bar.setOption(option2);
  180. // },5000)
  181. // let p;
  182. // setTimeout(()=>{
  183. // bar.setOption({
  184. // color: ['#0a73dc', '#04a2ae', '#424a95', '#2a7ebe', '#113b85', '#a2f9ff', '#01a0c8', '#5879c0', '#74e9f2', '#126087', '#99b5da'],
  185. // bg: {
  186. // backgroundColor: "#000000"
  187. // },
  188. // legend: {
  189. // show: true,
  190. // left: "70%",
  191. // top: '5%',
  192. // orient: 'horizontal',
  193. // itemWidth: 8,
  194. // itemHeight: 8,
  195. // borderRadius: 0,
  196. // textStyle: {
  197. // fontSize: 14,
  198. // color: "#ffffff"
  199. // }
  200. // },
  201. // tooltip: {
  202. // show: true,
  203. // paddingW:10,
  204. // paddingH: 10,
  205. // itemGap: 2,
  206. // //距目标的偏移值
  207. // offsetX: 15,
  208. // offsetY: 0,
  209. // titleFontSize:14,
  210. // titleColor: '#ff0000',
  211. // itemFontSize:12,
  212. // itemColor:"#ffffff",
  213. // borderColor: '#ccc',
  214. // borderWidth: 0,
  215. // backgroundColor: 'rgba(255,255,255,0)',
  216. // },
  217. // grid: {
  218. // // left: "0%",
  219. // // right: "20",
  220. // // top: "20%",
  221. // // bottom: "40%"
  222. // left: "20%",
  223. // right: "20",
  224. // top: "20%",
  225. // bottom: "20%"
  226. // },
  227. // valueAxis: {
  228. // textStyle: {
  229. // fontSize: 12,
  230. // color: "#ffffff",
  231. // shadowBlur: 5,
  232. // shadowColor: "#ff0000"
  233. // }
  234. // },
  235. // categoryAxis: {
  236. // textStyle: {
  237. // fontSize: 14,
  238. // color: "#ffffff",
  239. // shadowBlur: 0,
  240. // shadowColor: "#ffffff"
  241. // },
  242. // data: ["小米", "华为", "苹果", "三星"]
  243. // },
  244. // series: [{
  245. // name: "一季度销量",
  246. // data: [639539, -548671, 457822, 223133]
  247. // },
  248. // // {
  249. // // name: "二季度销量",
  250. // // data: [581244, 563334, 512544, 496554, 407788, 368555]
  251. // // }
  252. // ]
  253. // })
  254. // },4000);
  255. //
  256. // setTimeout(()=>{
  257. // bar.setCameraPosition(p);
  258. // },4000);