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

index.js 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. import ChartLine from '../../../src/chart/line/ChartLine22/ChartLine22.js';
  2. import Title from '../../../src/chart/commonOptions/title';
  3. import Grid from '../../../src/chart/commonOptions/grid';
  4. let chart = new ChartLine(document.getElementsByClassName('c1')[0], {});
  5. window.addEventListener('resize', () => {
  6. chart.resize();
  7. });
  8. let option = {
  9. color: ['#3FFFB8', '#ffff67', '#4169e1', '#ffc000', '#0000ff', '#ff7200', '#00ffff', '#ffe79e'],
  10. title: Title.option(''),
  11. bg: {
  12. backgroundColor: '#041326'
  13. },
  14. grid: Grid.containLabelOption,
  15. tooltip: {
  16. titleColor: '#ffffff',
  17. bgStyle: {
  18. backgroundColor: '#041326',
  19. borderColor: '#888e0e',
  20. borderWidth: 1
  21. },
  22. nameColor: '#ffda2a',
  23. valueColor: '#ffda2a'
  24. },
  25. legend: {
  26. itemHeight: 10,
  27. itemWidth: 10,
  28. itemAngelR: 20,
  29. left: '22%',
  30. top: '8%'
  31. },
  32. xAxis: {
  33. type: "category",
  34. // title: '日期',
  35. nameTextStyle: {
  36. fontSize: 12,
  37. color: '#ccc',
  38. },
  39. namePosition: 'end',
  40. // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
  41. data: ["班次1", "班次2", "班次3", "班次4", "班次5", "班次6", "班次7", '班次8', '班次9', '班次10', '班次11', '班次12', '班次13', '班次14'],
  42. boundaryGap: true,
  43. // scale: true,
  44. axisLine: {
  45. show: false,
  46. lineStyle: {
  47. color: 'rgba(255,255,255,0.2)',
  48. width: 2,
  49. type: 'solid'
  50. }
  51. },
  52. axisTick: {
  53. show: false,
  54. alignWithLabel: true,
  55. length: -2,
  56. lineStyle:{
  57. width:2,
  58. color:'rgba(255,255,255,0.1)',
  59. // opacity: 0.1,
  60. }
  61. },
  62. splitLine: {
  63. show: false,
  64. lineStyle: {
  65. color: 'rgba(255,255,255,1.)',
  66. width: 1,
  67. type: 'solid'
  68. }
  69. },
  70. axisLabel: {
  71. show: true,
  72. textStyle: {
  73. color: '#bdbdbd',
  74. backgroundColor: 'rgba(255,255,255,0.2)',
  75. highlightColor: 'rgba(255,255,255,0.4)',
  76. textRotation:0,
  77. }
  78. }
  79. },
  80. yAxis: {
  81. type: 'value',
  82. title: 'L',
  83. nameTextStyle: {
  84. fontSize: 12,
  85. color: '#606060',
  86. },
  87. namePosition: 'end',
  88. scale: true,
  89. axisLine: {
  90. show: true,
  91. lineStyle: {
  92. color: 'rgba(255,255,255,0.2)',
  93. width: 1,
  94. type: 'solid',
  95. distance: 2, //偏移距离
  96. }
  97. },
  98. axisTick: {
  99. show: true,
  100. alignWithLabel: false,
  101. length:-5,
  102. lineStyle:{
  103. width:2,
  104. color:'rgba(255,255,255,0.1)',
  105. // opacity: 0.1,
  106. }
  107. },
  108. splitLine: {
  109. show: false,
  110. lineStyle: {
  111. color: 'rgba(255,255,255,0.2)',
  112. // opacity: 0.2,
  113. width: 1,
  114. type: 'solid'
  115. }
  116. },
  117. axisLabel: {
  118. show: true,
  119. textStyle: {
  120. color: '#606060'
  121. }
  122. }
  123. },
  124. shape: {
  125. label: {
  126. show: false,
  127. textStyle: {
  128. fontSize: 12,
  129. fontWeight: 'normal',
  130. color: ''
  131. }
  132. },
  133. lineStyle: {
  134. width: 2,
  135. smooth: 0.2,
  136. },
  137. lineShadow: {
  138. shadowColor: '#000000',
  139. shadowOffsetX: 0,
  140. shadowOffsetY: 0,
  141. shadowBlur: 0
  142. },
  143. icon: {
  144. size: 30,
  145. type: '电流',
  146. path: 'https://img.icons8.com/dusk/200/000000/airplane-take-off.png'
  147. },
  148. circleSize: 5,
  149. },
  150. series: [
  151. {
  152. name: '数据',
  153. data: [380, 310, 330, 360, 310, 290, 320, 350, 320, 400, 410, 420, 380, 420],
  154. }
  155. ]
  156. };
  157. // setTimeout(()=>{
  158. // chart.setOption(option)
  159. // },3000)