echart.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import * as echarts from "echarts";
  2. export default function getData(params) {
  3. console.log(params || '')
  4. let data = [10, 34, 82, 93, 91, 133, 120]
  5. return {
  6. tooltip: {
  7. trigger: 'axis',
  8. axisPointer: {
  9. type: 'cross',
  10. label: {
  11. backgroundColor: '#6a7985'
  12. }
  13. }
  14. },
  15. grid: {
  16. top: 10,
  17. left: 0,
  18. right: 10,
  19. bottom: 0,
  20. containLabel: true,
  21. },
  22. xAxis: {
  23. type: 'category',
  24. boundaryGap: false,
  25. data: ['09', '10', '11', '12', '13', '14', '15'],
  26. axisLabel: {
  27. color: "#CCC",
  28. },
  29. axisTick: {
  30. show: false,
  31. },
  32. axisLine: {
  33. show: true
  34. },
  35. },
  36. yAxis: {
  37. type: 'value',
  38. axisLabel: {
  39. color: "#CCC",
  40. },
  41. axisLine: {
  42. show: true,
  43. lineStyle: {
  44. color: "#CCC",
  45. },
  46. },
  47. splitLine: {
  48. show: false,
  49. lineStyle: {
  50. color: "#CCC",
  51. },
  52. },
  53. },
  54. series: [{
  55. data: data,
  56. type: 'line',
  57. smooth: true,
  58. showSymbol: false,
  59. lineStyle: {
  60. width: 1
  61. },
  62. areaStyle: {
  63. opacity: 0.8,
  64. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  65. offset: 0,
  66. color: 'rgba(73, 185, 245,1)'
  67. }, {
  68. offset: 1,
  69. color: 'rgba(73, 185, 245,.1)'
  70. }])
  71. },
  72. }]
  73. }
  74. }