信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. import ChartLine from '../../../src/chart/line/ChartLine15/ChartLine15.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: ['#ffffff','#3fffa7','#3f90ff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
  12. title: {},
  13. bg: {
  14. backgroundColor: '#000000'
  15. },
  16. grid: Grid.option,
  17. tooltip: {
  18. titleColor:'#fff',
  19. bgStyle:{
  20. backgroundColor:'rgba(255,255,255,0.2)',
  21. // borderColor:'#888e0e',
  22. // borderWidth:1
  23. },
  24. nameColor:'#ffda2a',
  25. valueColor:'#ffda2a'
  26. },
  27. legend: {
  28. itemHeight: 10,
  29. itemWidth: 10,
  30. itemAngelR: 20,
  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','2017','2014','2015','2016','2017',],
  47. boundaryGap: true,
  48. // scale: true,
  49. axisLine: {
  50. show: false,
  51. lineStyle: {
  52. color: '#ffffff',
  53. opacity: 0.2,
  54. width: 2,
  55. type: 'solid'
  56. }
  57. },
  58. axisTick: {
  59. show: false,
  60. alignWithLabel: true,
  61. length: -2,
  62. lineStyle:{
  63. width:2,
  64. color:'rgba(255,255,255,0.1)',
  65. // opacity: 0.1,
  66. }
  67. },
  68. splitLine: {
  69. show: true,
  70. lineStyle: {
  71. color: 'rgba(255,255,255,0.2)',
  72. width: 1,
  73. type: 'solid'
  74. }
  75. },
  76. axisLabel: {
  77. show: true,
  78. textStyle: {
  79. color: '#797979',
  80. backgroundColor: 'rgba(255,255,255,0.05)',
  81. highlightColor: '#ffffff',
  82. textRotation:0,
  83. margin: 4,
  84. }
  85. }
  86. },
  87. yAxis: {
  88. type: 'value',
  89. title: '单位',
  90. nameTextStyle: {
  91. fontSize: 12,
  92. color: '#606060',
  93. },
  94. namePosition: 'end',
  95. scale: true,
  96. axisLine: {
  97. show: true,
  98. lineStyle: {
  99. color: '#ffffff',
  100. opacity: 0.2,
  101. width: 1,
  102. type: 'solid',
  103. distance: 2, //偏移距离
  104. }
  105. },
  106. axisTick: {
  107. show: true,
  108. alignWithLabel: false,
  109. length:-5,
  110. lineStyle:{
  111. width:2,
  112. color:'#ffffff',
  113. opacity: 0.1,
  114. }
  115. },
  116. splitLine: {
  117. show: false,
  118. lineStyle: {
  119. color: 'rgba(255,255,255,0.2)',
  120. width: 1,
  121. type: 'solid'
  122. }
  123. },
  124. axisLabel: {
  125. show: true,
  126. textStyle: {
  127. color: '#606060'
  128. }
  129. }
  130. },
  131. shape:{
  132. label: {
  133. show: false,
  134. textStyle: {
  135. fontSize: 12,
  136. fontWeight: 'normal',
  137. color: ''
  138. }
  139. },
  140. lineStyle: {
  141. width: 4,
  142. smooth: 'spline',
  143. },
  144. lineShadow: {
  145. // shadowColor: '#000000',
  146. shadowOffsetX: 0,
  147. shadowOffsetY: 0,
  148. shadowBlur: 5
  149. },
  150. circleSize: 5,
  151. bgGrid:{
  152. color: '#ffffff',
  153. opacity: 1,
  154. }
  155. },
  156. series: [
  157. {
  158. name: '类别一',
  159. type: 'bar',
  160. data: [800, 900, 600, 1200, 1300, 900, 1000,1200, 1300, 900, 1000,],
  161. }, {
  162. name: '类别二',
  163. type: 'bar',
  164. data: [1200, 1400, 650, 950, 1600, 1400, 1000,950, 1600, 1400, 1000],
  165. }
  166. ]
  167. };