getLineChartOptions.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. export default function ({ xAxisData, seriesData }, $echarts) {
  2. return {
  3. xAxis: {
  4. type: "category",
  5. data: xAxisData,
  6. axisLine: { lineStyle: { color: "#00ffe7", width: 2 } },
  7. axisLabel: {
  8. color: "#00ffe7",
  9. fontSize: 22,
  10. fontWeight: "bold",
  11. shadowColor: "#00ffe7",
  12. shadowBlur: 10,
  13. },
  14. splitLine: { show: false },
  15. },
  16. yAxis: {
  17. type: "value",
  18. axisLine: { lineStyle: { color: "#00ffe7", width: 2 } },
  19. axisLabel: {
  20. color: "#00ffe7",
  21. fontSize: 22,
  22. fontWeight: "bold",
  23. shadowColor: "#00ffe7",
  24. shadowBlur: 10,
  25. },
  26. splitLine: { lineStyle: { color: "rgba(0,255,231,0.1)" } },
  27. },
  28. series: [
  29. {
  30. data: seriesData,
  31. type: "line",
  32. smooth: true,
  33. symbol: "circle",
  34. symbolSize: 16,
  35. lineStyle: {
  36. color: {
  37. type: "linear",
  38. x: 0,
  39. y: 0,
  40. x2: 1,
  41. y2: 0,
  42. colorStops: [
  43. { offset: 0, color: "#00ffe7" },
  44. { offset: 1, color: "#0078ff" },
  45. ],
  46. },
  47. width: 5,
  48. shadowColor: "#00ffe7",
  49. shadowBlur: 20,
  50. },
  51. itemStyle: {
  52. color: "#00ffe7",
  53. borderColor: "#fff",
  54. borderWidth: 4,
  55. shadowColor: "#00ffe7",
  56. shadowBlur: 10,
  57. },
  58. areaStyle: {
  59. color: new $echarts.graphic.LinearGradient(0, 0, 0, 1, [
  60. { offset: 0, color: "rgba(0,255,231,0.5)" },
  61. { offset: 1, color: "rgba(0,120,255,0.1)" },
  62. ]),
  63. },
  64. },
  65. ],
  66. tooltip: {
  67. trigger: "axis",
  68. backgroundColor: "rgba(0,34,51,0.9)",
  69. borderColor: "#00ffe7",
  70. borderWidth: 2,
  71. textStyle: { color: "#00ffe7", fontSize: 26, fontWeight: "bold" },
  72. axisPointer: {
  73. lineStyle: {
  74. color: "#00ffe7",
  75. width: 3,
  76. type: "dashed",
  77. },
  78. },
  79. },
  80. grid: {
  81. left: "3%",
  82. right: "4%",
  83. bottom: "3%",
  84. containLabel: true,
  85. },
  86. };
  87. }