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

index.js 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. import ChartBar from '../../../src/chart/zaibei/ChartBar27/ChartBar27.js';
  2. import Title from "../../../src/chart/commonOptions/title";
  3. import Grid from "../../../src/chart/commonOptions/grid";
  4. let bar = new ChartBar(document.getElementsByClassName('c1')[0], {});
  5. window.addEventListener('resize', () => {
  6. bar.resize();
  7. });
  8. let options = {
  9. type: "p1",
  10. bg: {
  11. backgroundColor: '#000000'
  12. },
  13. title: Title.option('服装销售利润'),
  14. tooltip: {
  15. bgStyle: {
  16. backgroundColor: 'rgba(0,0,0,0.7)',
  17. // borderColor:'#888e0e',
  18. // borderWidth:1
  19. },
  20. },
  21. legend: {
  22. left: "18%",
  23. top: '6%',
  24. itemWidth: 12,
  25. circleSize: 4,
  26. textStyle: {
  27. fontSize: 16,
  28. // color: '#50a7bd'
  29. }
  30. },
  31. grid: {
  32. left: '18%',
  33. top: '20%',
  34. right: '18%',
  35. bottom: '18%',
  36. containLabel: false,
  37. },
  38. // legend: Legend.option,
  39. xAxis: {
  40. type: "category",
  41. data: ["类别一", "类别二", "类别三", "类别四", "类别五"],
  42. // min:0,
  43. axisLine: {
  44. show: false,
  45. lineStyle: {
  46. color: '#333333',
  47. width: 2,
  48. type: 'solid'
  49. }
  50. },
  51. axisTick: {
  52. show: false,
  53. alignWithLabel: false,
  54. interval: 'auto',
  55. length: 5,
  56. lineStyle: {
  57. color: '#333333',
  58. width: 1
  59. }
  60. },
  61. splitLine: {
  62. show: false,
  63. lineStyle: {
  64. color: '#333333',
  65. width: 1,
  66. type: 'solid'
  67. }
  68. },
  69. axisLabel: {
  70. show: true,
  71. textStyle: {
  72. fontSize: 16,
  73. color: '#797979',
  74. backgroundColor: 'rgba(255,255,255,0.05)',
  75. highlightColor: '#ffffff',
  76. }
  77. }
  78. },
  79. yAxis: {
  80. type: 'value',
  81. axisLine: {
  82. show: true,
  83. lineStyle: {
  84. color: '#333333',
  85. width: 2,
  86. type: 'solid',
  87. distance: 2, //偏移距离
  88. }
  89. },
  90. axisTick: {
  91. show: true,
  92. alignWithLabel: true,
  93. interval: 'auto',
  94. length: 3,
  95. lineStyle: {
  96. color: '#333333',
  97. width: 2
  98. }
  99. },
  100. splitLine: {
  101. show: true,
  102. lineStyle: {
  103. color: '#333333',
  104. width: 1,
  105. type: 'solid'
  106. }
  107. },
  108. axisLabel: {
  109. show: true,
  110. textStyle: {
  111. fontSize: 16,
  112. color: '#797979'
  113. }
  114. },
  115. bgColor: 'rgba(255,255,255,0.05)',
  116. },
  117. shape: {
  118. barCategoryGap: '60%',
  119. // barGap: '8%',
  120. label: {
  121. show: true,
  122. textStyle: {
  123. fontSize: 12,
  124. fontWeight: 'normal',
  125. color: '#00f4fe'
  126. },
  127. positionX: 5
  128. },
  129. circleSize: 5,
  130. },
  131. series: [{
  132. name: '花费',
  133. type: 'bar',
  134. data: [450, 50, 500, 250, 250]
  135. }],
  136. color: ["#3fffa7", "#3f90ff"],
  137. };
  138. // setTimeout(() => {
  139. // bar.setOption(options)
  140. // }, 3000);