123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <template>
- <view class="charts-box">
- <qiun-data-charts type="area" :opts="revenueOpts" :chartData="revenueChartData" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 公司营收
- revenueChartData: {},
- revenueOpts: {
- color: ["#4B98FE"],
- padding: [15, 15],
- dataLabel: false,
- xAxis: {
- disableGrid: true,
- },
- yAxis: {
- // gridColor: "rgba(230,230,230,0.6)",
- gridColor: "rgba(200,200,200,0.6)",
- disabled: false,
- disableGrid: false,
- gridType: 'dash',
- dashLength: '4',
- data: [{
- axisLineColor: "#FFFFFF",
- min: 0,
- }],
- },
- legend: {
- show: false,
- position: "top",
- float: "right",
- },
- extra: {
- area: {
- type: "curve",
- opacity: 0.8,
- addLine: true,
- width: 1,
- gradient: true,
- },
- },
- },
- dataList: [],
- list: {},
- fromData: {
- dateDay: '2024-01',
- homestayId: '1744620500506251265'
- },
- objList: {}
- }
- },
- onReady() {
- this.objList = wx.getStorageSync('fromData')
- console.log('交易趋势33333333', this.objList);
- this.fromData.dateDay = this.objList.dateDay
- this.fromData.homestayId = this.objList.homestayId
- // this.drawRevenueCharts();
- },
- methods: {
- // 交易趋势
- drawRevenueCharts() {
- this.list = this.objList
- console.log('交易趋势33333333', this.list);
- if (this.list != {}) {
- this.list.checkedInChant.forEach(item => {
- this.dataList.push(item.checkedInRatio)
- })
- }
- let list1 = {
- categories: [
- "01-01", "", "", "", "", "", "",
- "01-08", "", "", "", "", "", "",
- "01-15", "", "", "", "", "", "",
- "01-22", "", "", "", "", "", "",
- "01-29", "", ""
- ],
- series: [{
- name: "收入",
- data: this.dataList,
- legendShape: "circle",
- color: "#4088FE",
- pointShape: "none",
- }, ],
- }
- this.revenueChartData = JSON.parse(JSON.stringify(list1));
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .charts-box {
- width: 630rpx;
- height: 388rpx;
- }
- </style>
|