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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import Chart from "../../../src/chart/bar/ChartBar20/ChartBar20";
  2. // import bar15 from "./ChartBar15_1eba2";
  3. const consoleWarn = window.console.warn;
  4. window.console.warn = function () {
  5. const string = arguments[0];
  6. const filterStrings = [
  7. 'is not power of two',
  8. 'image is too big',
  9. 'marked for update',
  10. 'can\'t invert matrix'
  11. ];
  12. // filter warnings containing above strings
  13. const shouldBeFiltered = filterStrings.some(string => (
  14. arguments[0].includes('THREE') && arguments[0].includes(string)
  15. ));
  16. if (shouldBeFiltered) {
  17. // console.log("find",arguments[0])
  18. // log it to console without second argument, which contains reference to `image`
  19. // consoleWarn.call(null, arguments[0]);
  20. } else {
  21. // pass other warnings without changes
  22. consoleWarn.apply(null, arguments);
  23. }
  24. };
  25. let bar = new Chart(document.querySelector(".c1"), {});
  26. window.addEventListener("resize", function () {
  27. bar.resize()
  28. });
  29. let option1 = {
  30. color: ['#0a73dc', '#04a2ae', '#424a95', '#2a7ebe', '#113b85', '#a2f9ff', '#01a0c8', '#5879c0', '#74e9f2', '#126087', '#99b5da'],
  31. bg: {
  32. backgroundColor: "#000000",
  33. showBgPlane: true,
  34. bgPlaneColor: '#ffffff',
  35. borderColor: '#0000ff'
  36. },
  37. legend: {
  38. show: true,
  39. left: "80%",
  40. top: '15%',
  41. orient: 'horizontal',
  42. itemWidth: 8,
  43. itemHeight: 8,
  44. borderRadius: 0,
  45. textStyle: {
  46. fontSize: 12,
  47. color: "#ffffff",
  48. fontWeight: 'bold'
  49. }
  50. },
  51. tooltip: {
  52. show: true,
  53. paddingW: 10,
  54. paddingH: 10,
  55. itemGap: 2,
  56. //距目标的偏移值
  57. offsetX: 15,
  58. offsetY: 0,
  59. titleFontSize: 14,
  60. titleColor: '#ff0000',
  61. itemFontSize: 12,
  62. itemColor: "#ffffff",
  63. borderColor: '#ccc',
  64. borderWidth: 0,
  65. backgroundColor: 'rgba(255,255,255,0)',
  66. },
  67. grid: {
  68. left: "20%",
  69. right: "20",
  70. top: "20%",
  71. bottom: "20%"
  72. },
  73. shape: {
  74. faceColor: "#ffffff"
  75. },
  76. valueAxis: {
  77. textStyle: {
  78. fontSize: 12,
  79. color: "#ffffff",
  80. shadowBlur: 5,
  81. shadowColor: "#ff0000"
  82. }
  83. },
  84. categoryAxis: {
  85. textStyle: {
  86. fontSize: 14,
  87. color: "#ffffff",
  88. shadowBlur: 0,
  89. shadowColor: "#ffffff"
  90. },
  91. data: ["小米", "华为", "苹果", "三星", "vivo", "oppo"]
  92. },
  93. series: [{
  94. name: "一季度销量",
  95. data: [105319, 148671, 457822, 496554, 407788, 368555]
  96. },
  97. ]
  98. };
  99. //
  100. setTimeout(() => {
  101. bar.setOption(option1);
  102. }, 5000);