LineOne.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="charts-box">
  3. <qiun-data-charts type="area" :opts="revenueOpts" :chartData="revenueChartData" />
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. // 公司营收
  11. revenueChartData: {},
  12. revenueOpts: {
  13. color: ["#4B98FE"],
  14. padding: [15, 15],
  15. dataLabel: false,
  16. xAxis: {
  17. disableGrid: true,
  18. },
  19. yAxis: {
  20. // gridColor: "rgba(230,230,230,0.6)",
  21. gridColor: "rgba(200,200,200,0.6)",
  22. disabled: false,
  23. disableGrid: false,
  24. gridType: 'dash',
  25. dashLength: '4',
  26. data: [{
  27. axisLineColor: "#FFFFFF",
  28. min: 0,
  29. }],
  30. },
  31. legend: {
  32. show: false,
  33. position: "top",
  34. float: "right",
  35. },
  36. extra: {
  37. area: {
  38. type: "curve",
  39. opacity: 0.8,
  40. addLine: true,
  41. width: 1,
  42. gradient: true,
  43. },
  44. },
  45. },
  46. dataList: [],
  47. list: {},
  48. fromData: {
  49. dateDay: '2024-01',
  50. homestayId: '1744620500506251265'
  51. },
  52. }
  53. },
  54. onReady() {
  55. let obj = wx.getStorageSync('fromData')
  56. this.fromData.dateDay = obj.dateDay
  57. this.fromData.homestayId = obj.homestayId
  58. this.drawRevenueCharts();
  59. },
  60. methods: {
  61. // 交易趋势
  62. drawRevenueCharts() {
  63. let obj = wx.getStorageSync('fromData')
  64. this.list = obj
  65. this.list.dealLineChant.forEach(item => {
  66. this.dataList.push(item.orderAmount)
  67. })
  68. let list1 = {
  69. categories: [
  70. "01-01", "", "", "", "", "", "",
  71. "01-08", "", "", "", "", "", "",
  72. "01-15", "", "", "", "", "", "",
  73. "01-22", "", "", "", "", "", "",
  74. "01-29", "", ""
  75. ],
  76. series: [{
  77. name: "收入",
  78. data: this.dataList,
  79. legendShape: "circle",
  80. color: "#4088FE",
  81. pointShape: "none",
  82. }, ],
  83. }
  84. this.revenueChartData = JSON.parse(JSON.stringify(list1));
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .charts-box {
  91. width: 630rpx;
  92. height: 388rpx;
  93. }
  94. </style>