LineTwo.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. max: 1
  30. }],
  31. },
  32. legend: {
  33. show: false,
  34. position: "top",
  35. float: "right",
  36. },
  37. extra: {
  38. area: {
  39. type: "curve",
  40. opacity: 0.8,
  41. addLine: true,
  42. width: 1,
  43. gradient: true,
  44. },
  45. },
  46. },
  47. dataList: [],
  48. list: {},
  49. fromData: {
  50. dateDay: '2024-01',
  51. homestayId: '1744620500506251265'
  52. },
  53. objList: {}
  54. }
  55. },
  56. onReady() {
  57. this.objList = wx.getStorageSync('fromData')
  58. console.log('折线图11111', this.objList);
  59. this.fromData.dateDay = this.objList.dateDay
  60. this.fromData.homestayId = this.objList.homestayId
  61. // this.drawRevenueCharts();
  62. },
  63. methods: {
  64. // 交易趋势
  65. drawRevenueCharts() {
  66. this.list.checkedInChant.forEach(item => {
  67. this.dataList.push(item.checkedInRatio)
  68. })
  69. let list1 = {
  70. categories: ["01-01", "", "", "", "", "", "", "01-08", "", "", "", "", "", "", "01-15",
  71. "", "", "", "", "", "", "01-22", "", "", "", "", "", "", "01-29", "", "",
  72. ],
  73. series: [{
  74. name: "入住率",
  75. data: this.dataList,
  76. legendShape: "circle",
  77. color: "#600EFF",
  78. pointShape: "none",
  79. }, ],
  80. }
  81. this.revenueChartData = JSON.parse(JSON.stringify(list1));
  82. },
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .charts-box {
  88. width: 630rpx;
  89. height: 388rpx;
  90. }
  91. </style>