option.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import * as echarts from 'echarts'
  2. export const chartOption = {
  3. title: {
  4. show: true,
  5. text: '',
  6. subtext: '',
  7. textStyle: {
  8. color: '#fff',
  9. fontSize: 18,
  10. fontWeight: '600'
  11. },
  12. subtextStyle: {
  13. color: '#fff',
  14. fontSize: 14,
  15. fontWeight: '400',
  16. align: 'center'
  17. },
  18. textAlign: 'center',
  19. left: '50%',
  20. top: '5px'
  21. },
  22. grid: {
  23. top: '80px',
  24. bottom: '30px'
  25. },
  26. xAxis: {
  27. type: 'category',
  28. data: [],
  29. axisTick: {
  30. alignWithLabel: true
  31. },
  32. axisLabel: {
  33. style: {
  34. fill: '#fff'
  35. }
  36. },
  37. axisLine: {
  38. lineStyle: {
  39. color: '#fff'
  40. }
  41. }
  42. },
  43. yAxis: {
  44. type: 'value',
  45. name: '',
  46. nameTextStyle: {
  47. color: '#fff',
  48. fontSize: 14
  49. },
  50. splitLine: {
  51. show: false
  52. },
  53. axisLine: {
  54. lineStyle: {
  55. color: '#fff'
  56. }
  57. }
  58. },
  59. series: [{
  60. type: 'line',
  61. name: '',
  62. data: [],
  63. markLine: {
  64. data: [
  65. {
  66. yAxis: '',
  67. tooltip: {
  68. formatter: ''
  69. },
  70. label: {
  71. show: true, position: 'inside',
  72. color: '#83bff6',
  73. formatter: ''
  74. },
  75. lineStyle: {
  76. color: '#ff4757',
  77. type: 'dashed'
  78. }
  79. }
  80. ]
  81. },
  82. itemStyle: {
  83. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  84. { offset: 0, color: '#83bff6' },
  85. { offset: 0.5, color: '#188df0' },
  86. { offset: 1, color: '#188df0' }
  87. ])
  88. },
  89. emphasis: {
  90. itemStyle: {
  91. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  92. { offset: 0, color: '#2378f7' },
  93. { offset: 0.7, color: '#2378f7' },
  94. { offset: 1, color: '#83bff6' }
  95. ])
  96. }
  97. },
  98. label: {
  99. show: true,
  100. position: 'top',
  101. textStyle: {
  102. color: '#fff',
  103. fontSize: 14
  104. },
  105. formatter (params) {
  106. return params.value ? params.value : ''
  107. }
  108. }
  109. }],
  110. tooltip: {
  111. show: true,
  112. trigger: 'axis',
  113. formatter: '任务情况<br/>{b}:{c}<br/>'
  114. }
  115. }