LineTwo.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. }
  54. },
  55. onReady() {
  56. this.drawRevenueCharts();
  57. },
  58. methods: {
  59. // 交易趋势
  60. drawRevenueCharts() {
  61. let obj = wx.getStorageSync('fromData')
  62. this.list = obj
  63. this.list.checkedInChant.forEach(item => {
  64. this.dataList.push(item.checkedInRatio)
  65. })
  66. let list1 = {
  67. categories: ["01-01", "", "", "", "", "", "", "01-08", "", "", "", "", "", "", "01-15",
  68. "", "", "", "", "", "", "01-22", "", "", "", "", "", "", "01-29", "", "",
  69. ],
  70. series: [{
  71. name: "入住率",
  72. data: this.dataList,
  73. legendShape: "circle",
  74. color: "#600EFF",
  75. pointShape: "none",
  76. }, ],
  77. }
  78. this.revenueChartData = JSON.parse(JSON.stringify(list1));
  79. },
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .charts-box {
  85. width: 630rpx;
  86. height: 388rpx;
  87. }
  88. </style>