信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import ChartBar from '../../../src/chart/bar/ChartBar1/ChartBar1.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. setTimeout(() => {
  9. bar.setOption({
  10. color: ['#ff0000', '#faeb00', '#23ff95','#ffc000','#00f0ff','#0060ff','#4e00ff'],
  11. bg: {
  12. backgroundColor: '#161729'
  13. },
  14. title: Title.option(''),
  15. tooltip: {},
  16. grid: Grid.option,
  17. xAxis: {
  18. type: 'value',
  19. title:'(%)',
  20. nameTextStyle:{
  21. color:'#02b4e1'
  22. },
  23. axisLine: {
  24. show: false,
  25. lineStyle: {
  26. color: '#0093ff',
  27. width: 1,
  28. type: 'solid'
  29. }
  30. },
  31. axisTick: {
  32. show: true,
  33. alignWithLabel: false,
  34. interval: 'auto',
  35. length:2,
  36. lineStyle: {
  37. color: '#ffdd22',
  38. width:2,
  39. }
  40. },
  41. splitLine: {
  42. show: false,
  43. lineStyle: {
  44. color: '#293f5f',
  45. width: 1,
  46. type: 'solid'
  47. }
  48. },
  49. axisLabel: {
  50. show: true,
  51. textStyle: {
  52. color: '#02b4e1'
  53. }
  54. },
  55. warningLine: {
  56. show: true,
  57. warnValue: 100
  58. }
  59. },
  60. yAxis: {
  61. type: "category",
  62. reverse: true,
  63. data: ["数据1", "数据2", "总体"],
  64. axisTick: {
  65. show: false,
  66. alignWithLabel: false,
  67. interval: 'auto',
  68. lineStyle: {
  69. color: '#0093ff'
  70. }
  71. },
  72. axisLine: {
  73. show: false,
  74. lineStyle: {
  75. color: '#00dff7',
  76. width: 2,
  77. type: 'solid'
  78. }
  79. },
  80. splitLine: {
  81. show: false,
  82. lineStyle: {
  83. color: '#293f5f',
  84. width: 1,
  85. type: 'solid'
  86. }
  87. },
  88. axisLabel: {
  89. margin: 0,
  90. show: true,
  91. textStyle: {
  92. color: '#fff'
  93. }
  94. }
  95. },
  96. shape:{
  97. barCategoryGap: '30%',
  98. iconType:'icon5',
  99. label: {
  100. show: true,
  101. textStyle: {
  102. fontSize: 12,
  103. fontWeight: 'normal',
  104. color: '#fff'
  105. },
  106. unit:'%'
  107. },
  108. },
  109. series: [
  110. {
  111. name: '利润',
  112. type: 'bar',
  113. data: [85, 130, 230]
  114. }
  115. ]
  116. })
  117. }, 3000);