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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import Chart from "../../../src/chart/bar/ChartBar24/ChartBar24";
  2. import Title from "../../../src/chart/commonOptions/title";
  3. import Grid from "../../../src/chart/commonOptions/grid";
  4. let bar = new Chart(document.querySelector(".c1"), {});
  5. window.addEventListener("resize", function () {
  6. bar.resize()
  7. });
  8. const option = {
  9. color: ["#0054ff", "#cb703d"],
  10. bg: {
  11. backgroundColor: '#0b0c0e'
  12. },
  13. title: Title.option(''),
  14. grid: Grid.option,
  15. legend: {
  16. left: "18%",
  17. top: '6%',
  18. itemHeight: 12,
  19. itemWidth: 12,
  20. itemAngelR: 0,
  21. textStyle: {
  22. fontSize: 16,
  23. color: '#ffffff'
  24. }
  25. },
  26. tooltip: {
  27. titleColor: '#ffffff',
  28. bgStyle: {
  29. borderColor: 'rgba(255,255,255,0.1)',
  30. borderWidth: 2,
  31. backgroundColor: '#000000',
  32. }
  33. },
  34. xAxis: {
  35. type: "category",
  36. name: '年份',
  37. nameTextStyle: {
  38. fontSize: 12,
  39. color: '#ffffff',
  40. },
  41. namePosition: 'end',
  42. axisLine: {
  43. show: true,
  44. lineStyle: {
  45. color: 'rgba(255,255,255,0.1)',
  46. width: 2,
  47. type: 'solid'
  48. }
  49. },
  50. axisTick: {
  51. show: true,
  52. alignWithLabel: true,
  53. length: 2,
  54. lineStyle: {
  55. color: '#ffffff',
  56. }
  57. },
  58. splitLine: {
  59. show: false,
  60. },
  61. axisLabel: {
  62. show: true,
  63. textStyle: {
  64. fontSize:12,
  65. fontWeight:'normal',
  66. color: '#ffffff'
  67. }
  68. },
  69. highLightColor: 'rgba(255,255,255,0.5)',
  70. data: ['2014', '2015', '2016'],
  71. },
  72. yAxis: {
  73. type: 'value',
  74. nameTextStyle: {
  75. color: '#ffffff',
  76. fontSize: 14
  77. },
  78. axisLine: {
  79. show: true,
  80. lineStyle: {
  81. color: '#ffffff',
  82. width: 1,
  83. }
  84. },
  85. axisTick: {
  86. show: true,
  87. lineStyle: {
  88. color: '#ffffff',
  89. },
  90. length: 2,
  91. alignWithLabel: true
  92. },
  93. splitLine: {
  94. show: false
  95. },
  96. axisLabel: {
  97. textStyle: {
  98. color: '#ffffff'
  99. }
  100. },
  101. },
  102. shape: {
  103. barGap: '30%',
  104. barCategoryGap: '40%',
  105. width: "85%",
  106. },
  107. series: [
  108. {
  109. name: '类别一',
  110. data: [ 1450, 1150, 1350]
  111. }
  112. ]
  113. };
  114. // setTimeout(() => {
  115. // bar.setOption(option);
  116. // }, 2000);