信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. import ChartLine from '../../../src/chart/line/ChartLine16/ChartLine16.js';
  2. import Grid from '../../../src/chart/commonOptions/grid'
  3. let chart = new ChartLine(document.getElementsByClassName('c1')[0], {});
  4. window.addEventListener('resize', () => {
  5. chart.resize();
  6. });
  7. // setTimeout(()=>{
  8. // chart.setOption(option)
  9. // },2000)
  10. let option = {
  11. color: ['#3fffa7','#3f90ff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
  12. title: {},
  13. bg: {
  14. backgroundColor: '#000000'
  15. },
  16. grid: Grid.containLabelOption,
  17. tooltip: {
  18. // titleColor:'#fff',
  19. bgStyle:{
  20. backgroundColor:'rgba(0,0,0,0.7)',
  21. // borderColor:'#888e0e',
  22. // borderWidth:1
  23. },
  24. nameColor:'#ffffff',
  25. valueColor:'#ffffff'
  26. },
  27. legend: {
  28. itemHeight: 10,
  29. itemWidth: 10,
  30. // itemAngelR: 0,
  31. left:'22%',
  32. top:'8%',
  33. textStyle:{
  34. color: '#ffffff'
  35. }
  36. },
  37. xAxis: {
  38. type: "category",
  39. // title: '日期',
  40. nameTextStyle: {
  41. fontSize: 12,
  42. color: '#ccc',
  43. },
  44. namePosition: 'end',
  45. // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  46. data: ['2011','2012','2013','2014','2015','2016','2012','2013','2014','2015','2016'],
  47. boundaryGap: true,
  48. // scale: true,
  49. axisLine: {
  50. show: false,
  51. lineStyle: {
  52. color: 'rgba(255,255,255,0.2)',
  53. width: 2,
  54. type: 'solid'
  55. }
  56. },
  57. axisTick: {
  58. show: false,
  59. alignWithLabel: true,
  60. length: -2,
  61. lineStyle:{
  62. width:2,
  63. color:'rgba(255,255,255,0.1)',
  64. // opacity: 0.1,
  65. }
  66. },
  67. splitLine: {
  68. show: true,
  69. lineStyle: {
  70. color: 'rgba(102,102,102,0.2)',
  71. width: 1,
  72. type: 'solid'
  73. }
  74. },
  75. axisLabel: {
  76. show: true,
  77. textStyle: {
  78. color: '#bdbdbd',
  79. backgroundColor: 'rgba(255,255,255,0.05)',
  80. highlightColor: 'rgba(255,255,255,0.4)',
  81. textRotation:0,
  82. }
  83. }
  84. },
  85. yAxis: {
  86. type: 'value',
  87. title: '单位',
  88. nameTextStyle: {
  89. fontSize: 12,
  90. color: '#606060',
  91. },
  92. namePosition: 'end',
  93. scale: true,
  94. axisLine: {
  95. show: true,
  96. lineStyle: {
  97. color: 'rgba(255,255,255,0.2)',
  98. width: 1,
  99. type: 'solid',
  100. distance: 2, //偏移距离
  101. }
  102. },
  103. axisTick: {
  104. show: true,
  105. alignWithLabel: false,
  106. length:-5,
  107. lineStyle:{
  108. width:2,
  109. color:'rgba(255,255,255,0.1)',
  110. // opacity: 0.1,
  111. }
  112. },
  113. splitLine: {
  114. show: false,
  115. lineStyle: {
  116. color: 'rgba(255,255,255,0.2)',
  117. // opacity: 0.2,
  118. width: 1,
  119. type: 'solid'
  120. }
  121. },
  122. axisLabel: {
  123. show: true,
  124. textStyle: {
  125. color: '#606060'
  126. }
  127. }
  128. },
  129. shape:{
  130. label: {
  131. show: false,
  132. textStyle: {
  133. fontSize: 12,
  134. fontWeight: 'normal',
  135. color: ''
  136. }
  137. },
  138. lineStyle: {
  139. width: 2,
  140. },
  141. bgGrid:{
  142. color: 'rgba(255,255,255,0.05)',
  143. }
  144. },
  145. series: [
  146. {
  147. name: '类别',
  148. type: 'bar',
  149. data: [110, 3, 6, 14,90, 17, 3, 6, 14,90, 17],
  150. }
  151. ]
  152. };