echarts_20210803180613.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. export default function getData() {
  2. let data = Array.from(7).map((val, ind) => {
  3. return {
  4. day: new Date().getTime() - (7 - ind - 1),
  5. val: Math.ceil(Math.random() * 1000)
  6. }
  7. })
  8. console.log(data)
  9. return {
  10. color: ["rgba(4,187,255,1)"],
  11. xAxis: {
  12. type: "category",
  13. data: ["7.18", "7.19", "7.20", "7.21", "7.22", "7.23", "7.24"],
  14. axisLabel: {
  15. color: "#FFFFFF",
  16. },
  17. axisTick: {
  18. show: false,
  19. },
  20. },
  21. yAxis: {
  22. type: "value",
  23. max: function(value) {
  24. return value.max + value.max * 0.25;
  25. },
  26. axisLabel: {
  27. color: "#FFFFFF",
  28. },
  29. axisTick: {
  30. show: false,
  31. },
  32. },
  33. grid: {
  34. top: 40,
  35. left: 40,
  36. right: 0,
  37. bottom: 30,
  38. },
  39. series: [{
  40. type: "pictorialBar",
  41. barCategoryGap: "30%",
  42. symbol: 'path://M0,10 L10,10 L5,0 L0,10 z',
  43. label: {
  44. normal: {
  45. show: false,
  46. position: "top",
  47. textStyle: {
  48. color: "#fff",
  49. }
  50. }
  51. },
  52. markPoint: {
  53. data: [
  54. { type: 'max', name: '最大值', label: { color: "#fff", } },
  55. ]
  56. },
  57. data: [
  58. 1200,
  59. {
  60. value: 2000,
  61. itemStyle: {
  62. color: "rgba(255,239,143,1)",
  63. },
  64. },
  65. 1500,
  66. 800,
  67. 700,
  68. 1100,
  69. 1300,
  70. ],
  71. }, ],
  72. }
  73. }